Skip to main content

Dialog

Display modal dialogs over your application, built on Base UI.

View as Markdown

Installation

Component API

PropTypeDefaultDescription
triggerReactNode-
renderReactElement-
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.
onTriggerClick() => void-Fires when the trigger is pressed, before the dialog opens, for capturing which row triggered it, say, in a dialog reused across a list.
Fires when the trigger is pressed, before the dialog opens, for capturing which row triggered it, say, in a dialog reused across a list.
openboolean-
onOpenChange(open: boolean) => void-Called whenever it opens or closes, controlled or not.
Called whenever it opens or closes, controlled or not.
headerReactNode-
titlestring-The dialog's heading, wired up by Base UI's own Dialog.Title.
The dialog's heading, wired up by Base UI's own Dialog.Title.
descriptionReactNode-The body text, wired up by Base UI's own Dialog.Description.
The body text, wired up by Base UI's own Dialog.Description.
childrenReactNode-
cancelLabelstringCancelThe dismissing button's label.
The dismissing button's label.
confirmLabelstring-
onConfirm() => void-
showClosebooleantrueThe X in the corner.
The X in the corner.
confirmVariantprimary | dangerprimaryColor of the confirm button: primary or danger, for a destructive action like a delete.
Color of the confirm button: primary or danger, for a destructive action like a delete.
triggerIntentneutral | dangerneutralColor: neutral or danger, for a destructive confirmation.
Color: neutral or danger, for a destructive confirmation.
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.
shapenone | rounded | pillrounded
animatedbooleantrue
classNamestring-
focusboolean | stringtrue
containerHTMLElement | null-