Toggle Sidebar B
AppearanceLight & dark mode D

Alert Dialog

A modal dialog that interrupts the user with important content and expects a response.

Demo

Dark previewReplay preview

Basic

Dark previewReplay preview

Small

Set size="sm" on AlertDialogContent for a compact dialog.

Dark previewReplay preview

Media

AlertDialogMedia renders an icon or image alongside the header.

Dark previewReplay preview

Small with Media

Dark previewReplay preview

Destructive

Pass variant to AlertDialogAction and AlertDialogCancel for destructive confirmations.

Dark previewReplay preview

API Reference

AlertDialogContent

PropTypeDefaultDescription
size"default" | "sm""default"Dialog size. sm centers content and stacks the footer in a 2-col grid.

AlertDialogAction / AlertDialogCancel

PropTypeDefaultDescription
variantButtonVariants["variant"]default / "outline"Button style, e.g. destructive.
sizeButtonVariants["size"]"default"Button size.

AlertDialogMedia

PropTypeDefaultDescription
classstringContainer for an icon or image in the header.

Accessibility

Keyboard shortcuts and ARIA behavior.

Shortcut Description
EscCloses the dialog (returns focus to the trigger).
TabFocus is trapped inside the dialog while open.
  • Unlike Dialog, clicking outside does not close an alert dialog; the user must choose an action.