Overlays
Alert Dialog
A dialog that requires user response to proceed.
Installation
Usage
import {
AlertDialog,
AlertDialogClose,
AlertDialogDescription,
AlertDialogPanel,
AlertDialogFooter,
AlertDialogHeader,
AlertDialogPopup,
AlertDialogTitle,
AlertDialogTrigger,
} from "@/components/ui/alert-dialog"<AlertDialog>
<AlertDialogTrigger>Delete Account</AlertDialogTrigger>
<AlertDialogPopup>
<AlertDialogHeader>
<AlertDialogTitle>Are you absolutely sure?</AlertDialogTitle>
<AlertDialogDescription>
This action cannot be undone. This will permanently delete your account
and remove your data from our servers.
</AlertDialogDescription>
</AlertDialogHeader>
<AlertDialogPanel>Content</AlertDialogPanel>
<AlertDialogFooter>
<AlertDialogClose>Cancel</AlertDialogClose>
<AlertDialogClose>Delete Account</AlertDialogClose>
</AlertDialogFooter>
</AlertDialogPopup>
</AlertDialog>AlertDialogFooter Variant
The AlertDialogFooter component supports a variant prop to control its styling:
default(default): Includes a border-top, background color, and paddingbare: Removes the border and background for a minimal appearance
// Default variant (with border and background)
<AlertDialogFooter>
<AlertDialogClose>Cancel</AlertDialogClose>
<AlertDialogClose>Delete</AlertDialogClose>
</AlertDialogFooter>
// Bare variant (no border or background)
<AlertDialogFooter variant="bare">
<AlertDialogClose>Cancel</AlertDialogClose>
<AlertDialogClose>Delete</AlertDialogClose>
</AlertDialogFooter>