Overlays

Modal

A centered dialog overlay with header/body/footer slots.

html
<UiModal />

Title

title is the heading in the modal header.

Description

description is secondary text below the title, for the sentence that frames what the modal is asking.

Size

size sets how wide the panel gets — sm is max-w-sm, md max-w-lg, lg max-w-2xl, xl max-w-4xl.

Fullscreen

fullscreen grows the panel to fill the viewport, inside the same small margin a centered modal keeps.

fullscreen and size are mutually exclusive in effect — fullscreen ignores size.

Non-dismissible needs its own close control

:dismissible="false" disables both Escape and backdrop-click close — you must provide your own way to close the modal (e.g. a footer button) or it's stuck open.

Dismissible

dismissible is on by default. Setting it false disables both Escape and the backdrop click, so the modal can only be closed by something you put inside it — the right call while there's unsaved work.

:dismissible="false" disables both the Escape key and backdrop-click close — you must provide your own way to close it (e.g. a footer button), or it's stuck open.

Close button

closeButton are the cross in the header. Dropped along with title and description, the modal has no header at all.

Padded

padded is the body's own padding and scrolling. Turn it off for content that has to run flush to the panel edges — a full-bleed image, a table, an embedded map.

:padded="false" drops the body's own padding *and* its scroll container, for content that runs flush to the panel edges (a split sidebar/detail layout, a full-bleed image) — that content then has to bring its own overflow-y-auto, or it will simply be clipped.

Open

Bind it with v-model:open so whatever triggers the modal owns whether it's showing.

Open state: false

Default open

defaultOpen starts the modal open when uncontrolled. It's shown as source only here: a modal that opened itself would cover this page.

Renders open on mount.

header slot

Replaces title and description wholesale, for a header that needs markup of its own.


API Reference

Generated from the component's source — props, slots and emits as the component actually declares them.

Props

Prop
Type
Default
Description
string
The title displayed in the modal header.
string
The description displayed below the title in the modal header.
"sm" | "md" | "lg" | "xl"
'md'
boolean
false
Grows the panel to fill the viewport, inside the same small margin a centered modal keeps, instead of sizing it from `size`.
boolean
true
Whether clicking the backdrop or pressing Escape closes the modal.
boolean
true
Shows the close button in the header.
boolean
true
Whether the body gets its own padding and scrolling. Turn it off for content that runs flush to the panel edges (a split sidebar/detail layout, a full-bleed image) and owns its own scroll containers.
boolean
Whether the modal is open, for controlled usage with v-model:open.
boolean
false
Whether the modal is open by default when uncontrolled.

Slots

Slot
header
default
footer

Emits

Event
Payload
Description
update:open
[value: boolean]