A lightweight modal dialog component with CSS transitions. Perfect for confirmation dialogs and important interactions without motion library overhead.
The static Alert Dialog provides the same functionality as the animated version but uses CSS transitions for enter/exit animations. This results in a significantly smaller bundle size (~5KB vs ~22KB).
import {
AlertDialog,
AlertDialogTrigger,
AlertDialogContent,
AlertDialogHeader,
AlertDialogFooter,
AlertDialogTitle,
AlertDialogDescription,
AlertDialogAction,
AlertDialogCancel,
} from "@/components/ui/static/alert-dialog"<AlertDialog>
<AlertDialogTrigger>Open</AlertDialogTrigger>
<AlertDialogContent>
<AlertDialogHeader>
<AlertDialogTitle>Title</AlertDialogTitle>
<AlertDialogDescription>Description</AlertDialogDescription>
</AlertDialogHeader>
<AlertDialogFooter>
<AlertDialogCancel>Cancel</AlertDialogCancel>
<AlertDialogAction>Continue</AlertDialogAction>
</AlertDialogFooter>
</AlertDialogContent>
</AlertDialog>A simple confirmation dialog with title, description, and action buttons.
Use destructive styling for dangerous actions like deleting data.
Customize the dialog appearance with className props.
Built following WAI-ARIA Alert Dialog pattern with full keyboard support.
• Dialog uses role="alertdialog"
• Title announced via aria-labelledby
• Description announced via aria-describedby
• Focus is automatically moved to the dialog when opened