Skip to content

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:

ts
const { confirm } = useConfirm()

if (await confirm({ title: 'Delete this draft?', danger: true }))
  await remove()

Props

PropTypeDefaultDescription
openbooleanfalsev-model:open
titlestringHeading, and the accessible name
descriptionstringSits under the title, wired via aria-describedby
size'sm' | 'md' | 'lg' | 'xl''md'Maximum width from sm up
dismissiblebooleantrueEscape and overlay click close it
showClosebooleantrueRender the corner dismiss button
closeLabelstring'Close'Accessible name for that button
unstyledbooleanDrop built-in classes
classstringMerged onto the content panel
uiobjectoverlay, 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".