Skip to main content

Alert Dialog

Display urgent confirmation dialogs over your application, built on Base UI.

View as Markdown

Installation

Component API

PropTypeDefaultDescription
triggerReactNode-
triggerIconReactNode-A glyph beside the trigger's label.
A glyph beside the trigger's label.
triggerIconPositionleading | trailingleadingWhich end of the trigger triggerIcon sits at.
Which end of the trigger triggerIcon sits at.
openboolean-
onOpenChange(open: boolean) => void-Called whenever it opens or closes, controlled or not.
Called whenever it opens or closes, controlled or not.
iconReactNode-
titlestring-The dialog's heading, wired up by Base UI's own AlertDialog.Title.
The dialog's heading, wired up by Base UI's own AlertDialog.Title.
descriptionstring-The body text, wired up by Base UI's own AlertDialog.Description.
The body text, wired up by Base UI's own AlertDialog.Description.
cancelLabelstringCancelThe dismissing button's label.
The dismissing button's label.
confirmLabelstring-The confirming button's label.
The confirming button's label.
onConfirm() => void-
showClosebooleantrue
tonedanger | neutraldangerColors the badge and the confirm button together.
Colors the badge and the confirm button together.
triggerTonedanger | neutraldangerThe trigger's own color, independent of the dialog's tone - a neutral button can still open a destructive dialog.
The trigger's own color, independent of the dialog's tone - a neutral button can still open a destructive dialog.
sizesm | md | lgmdPadding and text size of the trigger and the popup's buttons, on the same scale as Button, so a dialog matches the buttons beside it.
Padding and text size of the trigger and the popup's buttons, on the same scale as Button, so a dialog matches the buttons beside it.
shapesquare | rounded | squircle | pillrounded
animatedbooleantrue
focusboolean | stringtrue
containerHTMLElement | null-