Primitive · CLI
Alert Dialog
Confirm destructive or irreversible actions with Base UI Alert Dialog.
Preview
npx shadcn@latest add @atroui/alert-dialogProject still here
Installation
Agent blurb — install command + no npm UI rule. For agents
npx shadcn@latest add @atroui/alert-dialogSource lands in your repo. Installation · Registry
Usage
Use only when the next click removes data or cannot be undone. Lead with the consequence; keep Cancel easy to reach.
tsx
import { Button } from "@/components/ui/button"
import {
AlertDialog,
AlertDialogAction,
AlertDialogCancel,
AlertDialogContent,
AlertDialogDescription,
AlertDialogFooter,
AlertDialogHeader,
AlertDialogTitle,
AlertDialogTrigger,
} from "@/components/ui/alert-dialog"
<AlertDialog>
<AlertDialogTrigger render={<Button variant="destructive" />}>Delete</AlertDialogTrigger>
<AlertDialogContent>
<AlertDialogHeader>
<AlertDialogTitle>Delete this project?</AlertDialogTitle>
<AlertDialogDescription>Cannot be undone.</AlertDialogDescription>
</AlertDialogHeader>
<AlertDialogFooter>
<AlertDialogCancel>Cancel</AlertDialogCancel>
<AlertDialogAction variant="destructive">Delete</AlertDialogAction>
</AlertDialogFooter>
</AlertDialogContent>
</AlertDialog>Alert Dialog