Alert Dialog
A modal dialog that interrupts the user with important content and expects a response.
Installation#
pnpm dlx shadcn@latest add @davinciui/alert-dialogUsage#
Composition: AlertDialog → Trigger + Content (Header/Title/Description + Footer/Action/Cancel).
Composition#
Use the following composition to build a Alert Dialog:
AlertDialog
├── AlertDialogTrigger
└── AlertDialogContent
├── AlertDialogHeader
│ ├── AlertDialogTitle
│ └── AlertDialogDescription
└── AlertDialogFooter
├── AlertDialogCancel
└── AlertDialogActionAPI Reference#
| Prop | Type | Default |
|---|---|---|
AlertDialogRoot dialog. | Component | — |
AlertDialogTriggerButton that opens the dialog. | Component | — |
AlertDialogContentContainer for dialog content. | Component | — |
AlertDialogTitleAccessible title. | Component | — |
AlertDialogDescriptionAccessible description. | Component | — |
classNameAdditional CSS classes. | string | — |
Accessibility#
Base UI Dialog traps focus, closes on Escape, and restores focus on close, with Title and Description wired for labelling. AlertDialogAction and Cancel are plain Buttons, so they do not close the dialog automatically.
Motion#
The dialog has no open or close animation in this implementation; overlay and popup appear instantly with backdrop blur. No prefers-reduced-motion handling exists because nothing transitions.
View source
Keep in mind
Need a custom component?
I build bespoke UI components & websites tailored to your brand.

