← All Components

AlertDialog

A modal dialog that interrupts the user with important content and expects a response. Built on Radix AlertDialog.

Default

Soft Confirmation

Sub-components

Sub-componentTypeDescription
AlertDialogRootWraps the alert dialog. Controls open state.
AlertDialog.TriggerRadix TriggerElement that opens the dialog.
AlertDialog.ContentComponentThe dialog panel with overlay and animations.
AlertDialog.HeaderdivContainer for title and description.
AlertDialog.TitleRadix TitleAccessible title for the dialog.
AlertDialog.DescriptionRadix DescriptionAccessible description text.
AlertDialog.FooterdivContainer for action and cancel buttons.
AlertDialog.ActionRadix ActionConfirms the action. Styled as primary button.
AlertDialog.CancelRadix CancelDismisses the dialog. Styled as secondary button.

Usage

<AlertDialog> <AlertDialog.Trigger asChild> <Button>Delete</Button> </AlertDialog.Trigger> <AlertDialog.Content> <AlertDialog.Header> <AlertDialog.Title>Are you sure?</AlertDialog.Title> <AlertDialog.Description> This action cannot be undone. </AlertDialog.Description> </AlertDialog.Header> <AlertDialog.Footer> <AlertDialog.Cancel>Cancel</AlertDialog.Cancel> <AlertDialog.Action>Continue</AlertDialog.Action> </AlertDialog.Footer> </AlertDialog.Content> </AlertDialog>