4.2.0
Core

Drawer

A bottom sheet the reader grabs and throws โ€” here dismissal is a gesture, not a decision.

Grabbed and thrown

The default drawer, and the whole interaction in one panel: grab the handle and drag it down. `shouldScaleBackground` is on by default, but vaul only scales an element marked `data-vaul-drawer-wrapper`, and nothing here supplies one โ€” so the page behind stays put. Reach for this shape when the panel is a summary the reader confirms or waves away โ€” the title carries the decision, so it is the first thing read and the last thing cut.

Usage

import {
  Drawer,
  DrawerClose,
  DrawerContent,
  DrawerDescription,
  DrawerFooter,
  DrawerHeader,
  DrawerOverlay,
  DrawerPortal,
  DrawerTitle,
  DrawerTrigger,
} from '@oceanic-hub/brand-system'
<Drawer>
  <DrawerTrigger>โ€ฆ</DrawerTrigger>
  <DrawerContent>
    <DrawerHeader>
      <DrawerTitle>โ€ฆ</DrawerTitle>
      <DrawerDescription>โ€ฆ</DrawerDescription>
    </DrawerHeader>
    <DrawerFooter>
      <DrawerClose>โ€ฆ</DrawerClose>
    </DrawerFooter>
  </DrawerContent>
</Drawer>

Composition

Use the following composition to build a Drawer:

Drawer
โ”œโ”€โ”€ DrawerTrigger
โ””โ”€โ”€ DrawerContent
    โ”œโ”€โ”€ DrawerHeader
    โ”‚   โ”œโ”€โ”€ DrawerTitle
    โ”‚   โ””โ”€โ”€ DrawerDescription
    โ””โ”€โ”€ DrawerFooter
        โ””โ”€โ”€ DrawerClose

Reach for it when letting go should cost nothing: a filter tray, a quick composer, the actions behind a row on a phone. The gesture is the whole argument โ€” the panel tracks the pointer and closeThreshold decides whether a release dismisses it. The corollary is the rule for when NOT to: a surface holding unsaved work should not be dismissable by a movement someone can make by accident.

shouldScaleBackground is on by default, but vaul only scales an element marked data-vaul-drawer-wrapper; nothing here supplies one, so the page behind stays put until a product wraps its own root.

It is not Sheet, and the axis is the interaction rather than the edge. Sheet is a Radix dialog that slides in and is dismissed deliberately โ€” Escape, an outside click, the close X it draws for you โ€” which is what a panel someone does work in needs; reach for it on a desktop surface. Dialog is still the answer when the page cannot continue until the question is answered. EntityDrawer is neither mechanism: a patterns layout that inspects one record inside its own positioned container, so the list keeps its context.

Only bottom is drawn. vaul's direction prop reaches the root, so a left or right drawer is expressible โ€” and gets the gesture with the wrong box, because DrawerContent hard-codes the bottom edge and the top radius. A side panel is Sheet.

DrawerTitle is the accessible name rather than decoration, so it is never omitted; use className="sr-only" when the design has no room for it. It matters more here than on a dialog, because the gesture that dismisses this panel is unavailable to exactly the readers the name serves.

Two of vaul's props do not behave the way their names suggest, and both are documented in their own sections below. modal={false} does not merely relax the modality โ€” it removes the overlay entirely, because the overlay is what locks scroll, so an outside click stops dismissing too. And dismissible={false} swallows every close, DrawerClose included; it only works alongside a controlled open.

Upstream is no longer this component. shadcn's Drawer moved from vaul to Base UI, so its page is the right list of examples and the wrong vocabulary for every one of them: swipeDirection is vaul's direction, snapPoint / onSnapPointChange are activeSnapPoint / setActiveSnapPoint, and disablePointerDismissal is dismissible={false}. Three have no counterpart at all. showSwipeHandle and DrawerSwipeHandle: the grab handle is drawn unconditionally, and vaul's handleOnly must not be passed โ€” the handle here is a styled div rather than vaul's own Handle, so restricting the drag to it would leave the panel with no drag surface. Nested drawers: DrawerNestedRoot is not exported and a stacked drag has no design here โ€” a second panel is a step the same drawer re-renders. And the responsive Dialog-on-desktop / Drawer-on-mobile swap is a decision about a product's surface rather than anything this component knows; its point is also invisible in a static first frame, which is the bar every section on this page has to clear.

Scrollable Content is the one upstream example missing from this page rather than folded into it, and it is Dialog's Scrolling body under another name: cap the middle, let it scroll, keep the title and the actions still. DrawerContent is already a flex column, so the arrangement is the one that page shows and there is no drawer-specific API in it โ€” only a drawer-specific fact worth knowing, which is that vaul begins the drag only when the scrolled region is already at its top, so a long body and the gesture never fight over the same pointer.

RTL is not supported โ€” recorded in pairings.json under direction: nothing in this package has been laid out or measured right-to-left.

Snap points

A tray that rests part-open before it commits: snapPoints takes fractions of the screen, least visible first, and a release settles on the nearest one. Reach for it when a glance is the common case and the full panel is the exception โ€” a peek costs no click, and growing it costs one drag. It is the affordance Sheet has no answer to, which is the clearest case for preferring this component over that one.

Non-modal

modal={false} keeps the page behind live โ€” still scrollable, still clickable, still holding focus. Reach for it when the panel annotates what is behind it rather than interrupting it: a playback tray, a running log, a selection summary the reader consults while they keep working. Know what it costs before you pass it: the overlay is what locks scroll, so dropping the modality drops the veil entirely and an outside click no longer dismisses. Only the gesture and an explicit close remain.

Not throwable

dismissible={false} takes the gesture away, for the one drawer whose content a flick must not discard โ€” a payment step, a destructive confirmation. It only works alongside a controlled open, and the reason is worth knowing rather than discovering: vaul swallows every close while the prop is set, DrawerClose included, so the button that dismisses this panel sets the state itself. If most of your drawers need it, they wanted Dialog.

API Reference

See the Drawer API page for every prop of every part, with types, defaults and the contract that pins them.

On this page