AlertDialog
Interrupts to confirm a decision that is hard to undo, like deleting a project or sending an email to thousands of people. Focus starts on the safe choice, and an outside click doesn't close it.
Installation
Set up Camaleo once (Installation), then import what you need. It renders on the client.
import { AlertDialog, AlertDialogTrigger, AlertDialogContent, AlertDialogTitle, AlertDialogDescription, AlertDialogClose, DialogActions } from "@camaleo/react";Anatomy
The same parts as Dialog, so every skin styles both alike. The popup adds data-kind="alert" and role="alertdialog".
Examples
Every example is a real file you can copy. Open them: the dialog wears the skin, mode and brand from the bar above.
API keys (3)
- Production server
Created Mar 14, 2026 - Staging server
Created Jun 2, 2026 - Zapier integration
Created Sep 21, 2026
Delete a row, keep focus
Click Delete. The row and its button go away, so finalFocus moves focus to the list heading and a status message confirms it.
Type the name to confirm
For the worst mistakes, like deleting a repository, make people type the name. The button stays disabled until it matches.
Waits for the request
Click Sign out devices. While the request runs, Esc and Cancel do nothing, so people see whether it worked before the dialog closes.
Focus on Cancel
Focus goes to the first focusable element. When that is a checkbox, point initialFocus at Cancel, so a quick Enter can't confirm.
Opened from a menu
Keep the dialog outside the menu and control it with open: the menu closes, the dialog stays, and finalFocus returns to the menu button.
Not only for deletes
Anything that can't be taken back deserves a confirm, like sending a newsletter. Use a solid button when it isn't destructive.
In context
Confirms guard the actions that would hurt to get wrong. These are whole pieces of UI you can copy, in the skin you picked.
Danger zone
These actions affect everyone in the project.
Hide it and make it read-only. You can restore it later.
Delete it with all its pages. This can't be undone.
Release notes
Billing
Team planActive
$24 per seat / month · 8 seats · renews on November 12, 2026
Guidelines
"Delete 3 files" says what happens. People can answer without rereading the question.
Neither says what will happen, so people click through without reading.
Deleting a workspace that 12 people use is worth stopping for.
"Saved" doesn't need an answer. Interrupting for it teaches people to dismiss alerts. Use a toast.
Props
eventDetails.reason says why, for example escape-key. Ignore it to keep the dialog open while a request runs.onOpenChange to control the state.It is always modal and never closes on an outside click. The other parts take the props of their element, plus render.
AlertDialogContent decides where focus goes:
Styling hooks
It shares the dialog's slots. Target data-kind="alert" to style only the confirms.
Attributes
Tokens it reads
Color
Shape & size
Type & motion
This component only
/* narrower and centered, only in confirms */
[data-slot="dialog-popup"][data-kind="alert"] {
text-align: center;
inline-size: min(24rem, calc(100vw - 2rem));
}Accessibility
- The popup has role="alertdialog", named by AlertDialogTitle and described by AlertDialogDescription, so screen readers read the question and its consequence together.
- A click outside does nothing: the dialog asks for an answer. Esc still closes it, as a Cancel.
- Put Cancel first. Focus starts there, so pressing Enter by habit never deletes anything.
- After the action, the trigger may be gone: set finalFocus and announce the result with role="status".