Component
Alert Dialog
A modal confirmation dialog styled with thick brutalist borders and flat shadows. Built on Radix UI Alert Dialog primitives, forcing the user to take action before closing.
Preview
Installation
pnpm dlx brutx@latest add alert-dialogUsage
import {
AlertDialog,
AlertDialogTrigger,
AlertDialogContent,
AlertDialogHeader,
AlertDialogTitle,
AlertDialogDescription,
AlertDialogFooter,
AlertDialogAction,
AlertDialogCancel,
} from "@/components/ui/alert-dialog"
import { Button } from "@/components/ui/button"
<AlertDialog>
<AlertDialogTrigger asChild>
<Button>Open</Button>
</AlertDialogTrigger>
<AlertDialogContent>
<AlertDialogHeader>
<AlertDialogTitle>Are you absolutely sure?</AlertDialogTitle>
<AlertDialogDescription>
This action cannot be undone.
</AlertDialogDescription>
</AlertDialogHeader>
<AlertDialogFooter>
<AlertDialogCancel asChild>
<Button variant="outline">Cancel</Button>
</AlertDialogCancel>
<AlertDialogAction asChild variant="danger">
<Button variant="danger">Confirm Action</Button>
</AlertDialogAction>
</AlertDialogFooter>
</AlertDialogContent>
</AlertDialog>Examples
Destructive Variant
Destructive buttons utilize neon red/pink highlights to clearly draw focus to critical actions.
API Reference
| Component | Description |
|---|---|
| AlertDialog | Manages open/closed states. |
| AlertDialogTrigger | Opens the modal panel. |
| AlertDialogContent | Modal content container overlaying web content. |
| AlertDialogHeader | Header layout box. |
| AlertDialogFooter | Footer button grid container. |
| AlertDialogTitle | Header title text element. |
| AlertDialogDescription | Detailed warning context. |
| AlertDialogAction | Primary confirm action (accepts standard button variants like destructive). |
| AlertDialogCancel | Cancel/close button action. |
Accessibility
- Uses standard WAI-ARIA
role="alertdialog"layout rules. - Focus is locked within the dialog context, and keyboard navigation keys are fully captured.
- Supports screen reader announcements and returns focus to triggers on cancel actions.