Dialog

Modal dialogs with springy transitions that trap focus, lock scrolling, and restore focus on overlay click or Escape.

Props

PropTypeDefaultDescription
openboolean—Controlled open state
defaultOpenbooleanfalseInitial open state when uncontrolled
onOpenChange(open: boolean) => void—Called whenever the open state changes
modalbooleantrueModal: locks scroll and traps focus, defaults to true
Dialog.TriggerButtonHTMLAttributes—Trigger button, wired with aria-haspopup / aria-expanded
asChildbooleanfalseOn Trigger / Close: merge behaviour onto the single child, e.g. <Button>
Dialog.ContentHTMLAttributes—The dialog surface, rendered in a portal on body
closeOnOverlayClickbooleantrueClose on overlay click, defaults to true; bumps when false
closeOnEscapebooleantrueClose on Escape, defaults to true; bumps when false
showCloseButtonbooleantrueShow the corner close button, defaults to true
closeLabelstring'Close'Accessible name of the corner close button
Dialog.HeaderHTMLAttributes—Header holding the Title and Description
Dialog.BodyHTMLAttributes—Scrollable body with overflow dividers
Dialog.FooterHTMLAttributes—Footer actions, right-aligned and stacked on narrow screens
Dialog.TitleHTMLAttributes—Title, used as the accessible name
Dialog.DescriptionHTMLAttributes—Description, linked through aria-describedby
Dialog.CloseButtonHTMLAttributes—A button that closes the dialog