Skip to content

Drawer

Overview

Root Drawer component, a mobile-friendly dialog variant that slides in from an edge and supports drag-to-dismiss.

Props

NameTypeRequiredDefaultDescription
openbooleanundefinedWhether the drawer is open.
defaultOpenbooleanundefinedThe default open state.
modalbooleanundefinedWhether to use modal behavior.
shouldScaleBackgroundbooleantrueWhether to scale the background when the drawer opens.
setBackgroundColorOnScalebooleanundefinedWhether to change the background color when scaled.
directionstringundefinedDirection the drawer slides in from.
dismissiblebooleanundefinedWhether the drawer can be dismissed by dragging, clicking outside, or pressing escape.
handleOnlybooleanundefinedWhen true, only allows the drawer to be dragged by the handle component.
nestedbooleanundefinedWhether this is a nested drawer.
fixedbooleanundefinedWhen true, prevents the drawer from moving upward when the keyboard opens.
noBodyStylesbooleanundefinedWhen true, prevents vaul from applying styles to the body element.
closeThresholdnumberundefinedDrag percentage threshold (0 to 1) required to close the drawer.
scrollLockTimeoutnumberundefinedDuration in ms after scrolling before drag is re-enabled.
snapPointsarrayundefinedSnap points as fractions (0 to 1) of screen height.
activeSnapPointnumber|stringundefinedThe currently active snap point.
preventScrollRestorationbooleanundefinedWhether to prevent scroll restoration on close.

Slots

default

Scoped slot.

Events

NameDescription
update:openEmitted when the open state changes.
update:activeSnapPointEmitted when the active snap point changes.
dragEmitted while the drawer is being dragged.
releaseEmitted when the drag is released.
closeEmitted when the close action is triggered.
animationEndEmitted when the open or close animation ends.

Full event reference

Source

client/lib/shell/drawer/Drawer.vue

Documents matching: server v3.0.0a1.post1client v3.0.0-alpha.2