Drawer

A drawer component that slides in from the side of the screen. It's built on top of the Vaul library and provides a customizable container for content.

Important Note

The drawer component requires a root element with the vaul-drawer-wrapper attribute to function properly. Make sure your app's root component has this attribute:

<template>
  <div vaul-drawer-wrapper>
    <!-- Your app content -->
  </div>
</template>

Props

NameDefaultType
openfalseboolean
Controls the visibility of the drawer
titlestring
Title for accessibility
containerClassstring object array
CSS class applied to the container of the drawer content
containerSizems m l xl full number
Size of the container or max-width in pixels
handletrueboolean
Whether to display the handle symbol at the top of the drawer
nestedfalseboolean
Uses Vaul's nested drawer root. Required when rendering a drawer inside another drawer
activeSnapPointnumber string null
Active snap point in controlled mode (v-model:activeSnapPoint)
rootPropsDrawerRootProps
Props to pass to the underlying Vaul root component. Type definitions
portalPropsDrawerPortalProps
Props to pass to the underlying Vaul portal component. Type definitions
overlaytrueboolean
Whether to render the drawer backdrop

Events

NamePayloadDescription
close-Emitted when the drawer is closed
update:activeSnapPointnumber string nullEmitted when the active snap point changes

Slots

NameAcceptsDescription
headeranyOptional header content rendered above drawer content
defaultanyThe content of the drawer