Props
| Name | Type | Default | Description |
|---|---|---|---|
description | string | undefined | - | One short line under the title, in the header — the shadcn
|
disabled | boolean | undefined | false | Disable EVERY user-initiated dismissal: backdrop click, Escape,
drag-to-dismiss AND the header close (×) button (denied attempts play the
deny nudge). Use it while an operation is in flight (e.g. a save) so the
drawer cannot be dismissed mid-work. Compare Guards dismissal only — the drag included. The fields and buttons inside stay live, so disable them yourself while a save is in flight. See example |
draggable | boolean | undefined | false | Enable drag-to-dismiss via VueUse A quarter of the extent, or a fast flick toward the edge, dismisses; anything shorter springs back. On a top or bottom sheet the gesture hands off to native scrolling first, so scrolling a long body never closes it. See example |
eager | boolean | undefined | false | Render offcanvas content immediately instead of waiting for the first open. The body renders lazily otherwise — nothing inside exists until the first open, which is what a test or a measurement runs into. See example |
focusTarget | string | undefined | - | 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 | boolean | "mobile" | undefined | - | Display the offcanvas fullscreen. Use
|
hideClose | boolean | undefined | false | Hides the default close (×) button in the header (e.g. for a Inverted from v2's |
modelValue | boolean | undefined | false | Used by v-model to open / close the panel. A panel with no |
persistent | boolean | undefined | false | Prevent closing via outside clicks, Escape key or drag-to-dismiss. The
header close (×) button STILL closes a persistent drawer — that is the
documented escape hatch; combine with Blocks the backdrop, Escape and the drag. The × still closes — that is the escape hatch — so pair it with |
pt | PtMap<BbOffCanvasPtPart, BbOffCanvasPtState> | undefined | - | Passthrough, object form: the same keys as the |
pt:close | PtValue | undefined | - | |
pt:close:fullscreen | PtValue | undefined | - | |
pt:close:open | PtValue | undefined | - | |
pt:content | PtValue | undefined | - | |
pt:content:fullscreen | PtValue | undefined | - | |
pt:content:open | PtValue | undefined | - | |
pt:description | PtValue | undefined | - | |
pt:description:fullscreen | PtValue | undefined | - | |
pt:description:open | PtValue | undefined | - | |
pt:footer | PtValue | undefined | - | |
pt:footer:fullscreen | PtValue | undefined | - | |
pt:footer:open | PtValue | undefined | - | |
pt:header | PtValue | undefined | - | |
pt:header:fullscreen | PtValue | undefined | - | |
pt:header:open | PtValue | undefined | - | |
pt:root | PtValue | undefined | - | |
pt:root:fullscreen | PtValue | undefined | - | |
pt:root:open | PtValue | undefined | - | |
pt:title | PtValue | undefined | - | |
pt:title:fullscreen | PtValue | undefined | - | |
pt:title:open | PtValue | undefined | - | |
side | "left" | "right" | "top" | "bottom" | undefined | "left" | Which viewport edge the offcanvas docks to (and slides in from). Called |
size | Responsive<OffCanvasSize> | undefined | "sm" | Controls the maximum size of the offcanvas panel. Accepts named presets from The extent along the panel's own axis, not a width: the same |
stack | string | undefined | - | Name of the stack this drawer belongs to. Drawers sharing the same Panels sharing a name step back and leave a peeking band — the opposite of |
stackGap | number | undefined | 60 | Pixels each stacked parent drawer shifts inward when a child opens on top, leaving a peeking band of the parent visible. How much of the parent stays visible behind a child. Only the top two open panels keep a dimmed and blurred backdrop; deeper ones go transparent, so a deep stack does not read as layers of dimming. See example |
title | string | undefined | - | Title text announced to assistive technologies. If omitted, no header is rendered and accessibility must be handled manually. The accessible name, not just a heading: it wires |
transitionDuration | number | undefined | 250 | Controls the duration of the open and close animations. Times both the slide and when |
v-model
Values kept in sync through v-model.
| Name | Type | Description |
|---|---|---|
modelValue | boolean | undefined | The only way to open a panel. There is no exposed |
Events
| Name | Type | Description |
|---|---|---|
hidden | (event: "hidden"): void | |
hide | (event: "hide"): void | |
show | (event: "show"): void | Fires as the model turns true, before the slide. The hook for reseeding a draft so Cancel is a real discard. See example |
shown | (event: "shown"): void | |
update:modelValue | (event: "update:modelValue", value: boolean): void |
Slots
The listed properties are the ones exposed to the slot scope.
| Name | Type | Description |
|---|---|---|
default | { close: () => void; } | Primary body content of the off-canvas panel, rendered in the scrollable body area. The only region that scrolls, and on a draggable top or bottom panel it is also what absorbs a drag until it reaches its own edge. See example |
description | BbOffCanvasDescriptionSlotProps | Replaces the description text under the title. Renders the header even
when |
footer | object | Content rendered in the panel footer, below the body area. Typically used for action buttons. Stays pinned while the body scrolls. One primary action — Apply, Save, Assign — with its counterweight beside it. See example |
header | BbOffCanvasHeaderSlotProps | Replaces the entire off-canvas header section (title + close button). Maintains accessibility wiring via the provided props. Providing it renders a header even with no |
title | BbOffCanvasTitleSlotProps | Replaces the default title text inside the header. Remains linked to the
panel through |
Changes from v2
Props removed or renamed in 3.0. If you are coming from v2, the answer is here.
compactremovedfails silentlydirectionsidefails silentlyshowClosehideClosefails silently