Dialog

Modal dialog with smooth enter/exit animations and overlay — three widths, the largest a canvas for a sidebar.

Installation

Installs the Base UI flavor. Switch in the right panel.

Basic

Inspect

Sizes

Use sm for a confirmation, lg for a form, and xl for a layout of its own.

Inspect

Controlled

Inspect

API Reference — Dialog

PropTypeDefaultDescription
open / defaultOpenbooleanControlled or initial open state.
onOpenChange(open: boolean) => voidCalled when the dialog opens or closes.
modalbooleantrueTrap focus and lock page scrolling while open.

API Reference — DialogTrigger / DialogClose

PropTypeDefaultDescription
renderReactElementThe element that becomes the trigger.
asChildbooleanfalseCompose the trigger or close control onto its child.

API Reference — DialogContent

PropTypeDefaultDescription
size"sm" | "lg" | "xl""sm"400, 540, or 880px surfaces; xl is intended for a layout of its own.
containerHTMLElement | nullOptional portal target for bounded overlays.
childrenReactNodeThe dialog's accessible header, body, and footer.