Alert Dialog
A modal dialog that interrupts the user with important content and expects a response before it can be dismissed.
ui@radix-ui/react-alert-dialog@radix-ui/react-slotclass-variance-authority
Installation
$npx futureuikit add alert-dialog
Import
import { AlertDialog } from "@/components/ui/alert-dialog"
Layout Variant
Color Theme
Shape
Spacing
Named Keys & Props
Pass these exact named keys as props on <AlertDialog />. Click any color pill to copy the prop.
colorDefault is "default"(Black & White)variantVisual style"solid""outline""ghost""link"shapeCorner shape"default""square""rounded""sharp"spacingInner spacing"default""2x""4x""6x""8x"Usage Example
A basic implementation example to get you started.
Example Implementation
import {
AlertDialog,
AlertDialogAction,
AlertDialogCancel,
AlertDialogContent,
AlertDialogDescription,
AlertDialogFooter,
AlertDialogHeader,
AlertDialogTitle,
AlertDialogTrigger,
} from "@/components/ui/alert-dialog";
export default function Example() {
return (
<AlertDialog>
<AlertDialogTrigger>Open</AlertDialogTrigger>
<AlertDialogContent>
<AlertDialogHeader>
<AlertDialogTitle>Are you sure?</AlertDialogTitle>
<AlertDialogDescription>This action cannot be undone.</AlertDialogDescription>
</AlertDialogHeader>
<AlertDialogFooter>
<AlertDialogCancel>Cancel</AlertDialogCancel>
<AlertDialogAction>Continue</AlertDialogAction>
</AlertDialogFooter>
</AlertDialogContent>
</AlertDialog>
);
}Features
Key capabilities and highlights.
Key Capabilities
- ◆Accessible modal built on Radix UI primitives.
- ◆Includes header, description, footer, and action/cancel buttons.
- ◆Traps focus and blocks interaction with the rest of the page.
Notes
Important implementation details to consider.
Implementation Details
- ◆Install: Run 'npx futureuikit add alert-dialog'.
- ◆Import: 'import { AlertDialog, AlertDialogTrigger, AlertDialogContent, AlertDialogAction, AlertDialogCancel } from "@/components/ui/alert-dialog";'
- ◆Usage: Wrap a trigger and content to present a confirmation or alert modal.