Alert Dialog
A modal dialog that interrupts the user with important content and expects a response.
Demo
Usage
Import the parts you need from the component's folder.
ts
import {
AlertDialog,
AlertDialogTrigger,
AlertDialogPortal,
AlertDialogOverlay,
AlertDialogContent,
AlertDialogHeader,
AlertDialogFooter,
AlertDialogMedia,
AlertDialogTitle,
AlertDialogDescription,
AlertDialogAction,
AlertDialogCancel,
} from "@/components/ui/alert-dialog";Basic
Small
Set size="sm" on AlertDialogContent for a compact dialog.
Media
AlertDialogMedia renders an icon or image alongside the header.
Small with Media
Destructive
Pass variant to AlertDialogAction and AlertDialogCancel for destructive confirmations.
API Reference
AlertDialogContent
AlertDialogAction / AlertDialogCancel
AlertDialogMedia
Accessibility
Keyboard shortcuts and ARIA behavior.
- Unlike Dialog, clicking outside does not close an alert dialog; the user must choose an action.