Overlays
IDialog
A modal, with header, body and footer slots. It portals to the body, traps focus, and closes on Escape or an overlay click unless you say otherwise.
The footer slot receives close, so the common case needs no state handling of its own.
Forcing a choice
:dismissible="false" refuses Escape and the overlay. Pair it with :show-close="false" when one of the buttons has to be chosen.
Sizes
sm, md (default), lg and xl cap the width from the sm breakpoint up. Below it the dialog is full-width minus a margin.
Scrolling
The body scrolls on its own, so the header and footer stay put on a short screen.
Confirmations
For a yes/no question, use useConfirm(). Mount <IConfirmDialog /> once, then call it from anywhere, including plain functions outside a component:
const { confirm } = useConfirm()
if (await confirm({ title: 'Delete this draft?', danger: true }))
await remove()Props
| Prop | Type | Default | Description |
|---|---|---|---|
open | boolean | false | v-model:open |
title | string | — | Heading, and the accessible name |
description | string | — | Sits under the title, wired via aria-describedby |
size | 'sm' | 'md' | 'lg' | 'xl' | 'md' | Maximum width from sm up |
dismissible | boolean | true | Escape and overlay click close it |
showClose | boolean | true | Render the corner dismiss button |
closeLabel | string | 'Close' | Accessible name for that button |
unstyled | boolean | — | Drop built-in classes |
class | string | — | Merged onto the content panel |
ui | object | — | overlay, content, header, title, description, body, footer, close |
Slots: trigger, header, title, description, default (body), and footer (receives close).
The corner button closes the dialog even when dismissible is false; hide it with :show-close="false".