Props
| Name | Description |
|---|---|
adaptive Type: booleanDefaultconfig.adaptive (true) | On mobile, renders as a Three-state on purpose: unset falls back to |
defaultData Type: Record<string, any> | What What a create binds: every opening without data gets a fresh copy, an edit lays its row over it (one level). |
description Type: string | One short line under the title, muted (the shadcn |
eager Type: booleanDefaultfalse | Keep the body mounted while closed, from before the first opening. Without it the body mounts per opening and unmounts after Reach for it only when something has to read or measure the body before it has ever been open — a chart, a test, an SSR snapshot. Leaving it off is what keeps a page with many dialogs cheap. See example |
focusTarget Type: string | CSS selector of the element to focus after opening. Defaults to the first tabbable element. Chooses where focus starts, never whether it is contained: |
fullscreen Type: boolean | "mobile" | Display the dialog fullscreen. Use Fills the viewport minus the page margin (20px, 14px on mobile) — deliberately not edge to edge. It overrides |
hideClose Type: booleanDefaultfalse | Hide the default close (×) button. The button is shown by default; set this to remove it (e.g. for a Inverted from v2's |
id Type: string | Names the dialog for One dialog per id: it is also the DOM id. Many rows open the same dialog with their own |
modelValue Type: booleanDefaultfalse | Used by v-model to open / close the dialog. A dialog with no |
navigation Type: booleanDefaultfalse | Syncs the open state with the URL: opening writes Back closes the dialog like |
offCanvasProps Type: Partial<BbOffCanvasProps> | Props for the phone sheet (the Merged last, so it wins over both the forwarded dialog props and the sheet's own defaults. The drawer's edge prop is |
persistent Type: booleanDefaultfalse | Blocks closing by outside click or Escape. The header close (×) STILL closes a persistent dialog, the documented escape hatch: add Blocks the backdrop and Escape only. The × still closes, by design, so |
preventClose Type: booleanDefaultundefined (follows a saving form inside) | Refuses every user close (backdrop, Escape, the ✕, the slots' Rarely written: unset, the dialog already locks itself while a |
pt Type: PtMap<BbDialogPtPart, BbDialogPtState> | Passthrough, object form: the same keys as the |
pt:<part> Type: PtValue | Passthrough, attribute form: one attribute per part, |
queryKey Type: stringDefault"dialog" | The query key Two URL dialogs on one page need their own key. |
replace Type: booleanDefaultfalse | With Swaps the history entry instead of pushing one, so Back leaves the page rather than closing the dialog. See example |
size Type: Responsive<NonNullable<number | CssSize | keyof BbDialogSizes | undefined>>Default"sm" | Controls the maximum width of the dialog. Accepts named presets from A maximum width; the height always hugs the content. The v3 presets are narrower than v2's |
snap Type: BbSnapPoint | The phone sheet's snap stop (Q71.8), one of the |
snapPoints Type: BbSnapPoint[] | Heights the phone sheet rests at, smallest first: a screen fraction ( Reaches the phone sheet only; the centred modal ignores it. See example |
stack Type: string | Name of this dialog's stack. Dialogs with the same Members of a dialog stack replace one another. The identically named prop on |
title Type: string | Title text announced to assistive technologies. If omitted, no header is rendered (unless a The accessible name, not just a heading: it wires |
transitionDuration Type: numberDefault250 | Controls the duration of the open and close animations. Times both the animation and when |
v-model
Values kept in sync through v-model.
| Name | Description |
|---|---|
modelValue Type: boolean | For a dialog your state opens (a route, a watcher); a button opens one by |
snap Type: BbSnapPoint |
Events
| Name | Description |
|---|---|
hide Type: (result: BbDialogResult): void | Emitted as soon as the dialog starts to close (model becomes false), with the opening's result: the same object its promise settles with, Fires as the close starts, with the opening's result: |
show Type: (): void | Emitted as soon as the dialog starts to open (model becomes true). Fires as the dialog starts to open, before the transition, with the opening's |
shown Type: (): void | Emitted once the open transition has run (symmetric with |
update:modelValue Type: (value: boolean): void | Emitted with the new value whenever |
update:snap Type: (value: BbSnapPoint | undefined): void | Emitted with the new value whenever |
Slots
The listed properties are the ones exposed to the slot scope.
| Name | Description |
|---|---|
default Type: BbDialogDefaultSlotProps | Primary body content of the dialog, rendered in the scrollable body area. The only region that scrolls, and it renders lazily — nothing inside exists until the first open unless you set |
description Type: BbDialogDescriptionSlotProps | Replaces the description text under the title. Renders the header even when |
footer Type: BbDialogFooterSlotProps | Content rendered in the dialog footer, below the body area. Typically used for action buttons. Stays pinned while the body scrolls, and lays out what you slot in as a row at the end, 8px apart: no wrapper |
header Type: BbDialogHeaderSlotProps | Replaces the whole header (title and ✕) on both surfaces, so it owns closing: wire your control to Replaces the header on both surfaces, so it also replaces the ×: render your own control wired to |
title Type: BbDialogTitleSlotProps | Replaces the default title text inside the header. Remains linked to the dialog through |
Renamed and removed
Names from v2 and from earlier 3.0 betas that no longer work, and what to write instead.
compactremovedfails silentlyhideHeaderremovedfails silentlyoverlayClassesremovedfails silentlypanelClassesremovedfails silentlyshowClosehideClosefails silently