humanonlyweb/ui

Dialog

A modal dialog.

Markdown

Examples

Basic

Keyboard shortcuts

Work faster with these.

Copy code

Form

The footer slot gets a close function.

Rename workspace

Copy code

Required step

With dismissible off, Escape, the backdrop and the × button do nothing; only your own buttons close it.

We've updated our terms

Accept them to keep using your account.

Copy code

API

PropTypeDefault
title

Heading, which names the dialog.

string—
label

Accessible name when there's no visible title.

string—
description

Supporting text, announced as the dialog's description.

string—
dismissible

Whether Escape, the backdrop and the header's close button can close it. The slots' close always can.

booleantrue
size

Size hook, exposed as data-dialog-size.

"lg" | "md" | "sm" | "xl""md"
flush

Layout hook for edge-to-edge content, exposed as data-dialog-flush.

booleanfalse
closeOnBackdrop

Close when the backdrop is clicked.

booleantrue
showCloseButton

Render the header's close button.

booleantrue
open

Whether the dialog is open.

booleanfalse
EventPayload
close

Closed by any means.

[]
update:open

v-model:open update.

[value: boolean]
SlotProps
default

Body content. Mounted on first open.

{ close: () => void; }
header

Replaces the title and description.

—
footer

Actions, e.g. buttons.

{ close: () => void; }
close-icon

Replaces the close button's icon.

—

Styling

Parts
dialogdialog-paneldialog-headerdialog-header-textdialog-titledialog-descriptiondialog-closedialog-bodydialog-footer
States
data-dialog-sizedata-dialog-flush

Keyboard

KeysAction
EscapeClose (when dismissible)
TabCycle within the dialog

Accessibility

  • The page behind is inert and doesn't scroll; focus returns to the opener on close.
  • Named by title, or label without one.