Toggle Sidebar B
AppearanceLight & dark mode D

Dialog

A window overlaid on either the primary window or another dialog window, rendering the content underneath inert.

Demo

Replay preview

Close Button

Use DialogClose to render a custom close button, for example in the footer.

Replay preview

No Close Button

Set showCloseButton to false to hide the default close button in the top-right corner.

Replay preview

Scrollable Content

Constrain the body with max-height and overflow-y-auto for long content.

Replay preview

API Reference

Dialog

PropTypeDefaultDescription
openbooleanOpen state. Supports v-model:open.
modalbooleantrueBlock interaction with the rest of the page while open.
EventDescription
update:openFires when the dialog opens or closes.

DialogContent

PropTypeDefaultDescription
showCloseButtonbooleantrueShow the ✕ button in the top-right corner.
classstringExtra classes, e.g. sm:max-w-sm for width.

DialogFooter

PropTypeDefaultDescription
showCloseButtonbooleanfalseRender a built-in outline Close button.

DialogTrigger / DialogClose

PropTypeDefaultDescription
asChildbooleanfalseMerge props onto the child element (e.g. a Button).

Accessibility

Keyboard shortcuts and ARIA behavior.

Shortcut Description
EscCloses the dialog.
TabFocus is trapped inside the dialog while open.