Skip to content

Dialog ​

Last updated

Demo ​

dialog/demo.vue

Dialog uses Reka UI for backdrop, focus trap, Escape/outside dismissal, scroll lock and title/description associations. Shared tokens supply its appearance.

Props ​

PropDescriptionTypeDefault
v-model:openOpen statebooleanfalse
titleVisible titlestring—
descriptionDescriptionstring—
accessibleTitleAssistive title when no visible title existsstring'对话框'
portalToExisting overlay container within the themestring | HTMLElementConfigProvider / body
closeLabelAccessible close button namestring'关闭'

Provide a visible title whenever possible. Only use a descriptive accessible-title when the design explicitly hides the heading. Set close-label="Close" to localize the close control along with your content.

Class, id, data attributes and events forward to content. Explicit aria-describedby can associate consumer help text. Reka UI retains the focus trap, Escape and focus restoration. Point portal-to at an existing container within the same local theme. Long titles wrap with space reserved for close.

Registry ​

Copy Dialog through Registry distribution; installation includes Reka UI, Sass and tokens.

Slots ​

NameDescription
triggerTrigger, using as-child to forward behavior to your button
titleCustom title
descriptionCustom description
defaultBody content