Skip to main content

Alert Dialog

StorybookView in Storybook

Explore interactive examples and all component variations in our Storybook.

The AlertDialog component is a modal dialog that interrupts the user with important content and expects a response. It's perfect for confirmations, warnings, and critical actions that require user attention.

Basic Usage​

Delete Confirmation​

Warning Dialog​

Success Confirmation​

Custom Content​

Properties​

AlertDialog​

PropertyTypeDescription
defaultOpenbooleanThe open state of the dialog when it is initially rendered.
openbooleanThe controlled open state of the dialog.
onOpenChange(open: boolean) => voidEvent handler called when the open state changes.

AlertDialogTrigger​

PropertyTypeDescription
asChildbooleanChange the default rendered element for the one passed as a child.

AlertDialogContent​

PropertyTypeDescription
classNamestringAdditional CSS classes for styling.
forceMountbooleanUsed to force mounting when more control is needed.

AlertDialogHeader​

PropertyTypeDescription
classNamestringAdditional CSS classes for styling.

AlertDialogFooter​

PropertyTypeDescription
classNamestringAdditional CSS classes for styling.

AlertDialogTitle​

PropertyTypeDescription
classNamestringAdditional CSS classes for styling.

AlertDialogDescription​

PropertyTypeDescription
classNamestringAdditional CSS classes for styling.

AlertDialogAction​

PropertyTypeDescription
classNamestringAdditional CSS classes for styling.

AlertDialogCancel​

PropertyTypeDescription
classNamestringAdditional CSS classes for styling.

Customization​

You can customize the appearance of the AlertDialog using CSS classes or Tailwind CSS.

The AlertDialog component is built on top of Radix UI's Alert Dialog primitive, providing a fully accessible and customizable modal dialog for critical user interactions.