Skip to content

Migrate from vaul

import { Drawer } from 'vaul';
import 'vaul/style.css';
import { Drawer } from 'scrollsheet';
import 'scrollsheet/styles.css';

Install scrollsheet, then preview the changes on a clean working tree. Pass the directory that contains your drawer wrappers.

Terminal window
npm install scrollsheet
npx scrollsheet-codemod vaul src --dry-run

Read the file:line report for props that are ignored or behave differently. When you’re ready, run npx scrollsheet-codemod vaul src and review the diff. The codemod rewrites Drawer imports, including aliases like shadcn’s DrawerPrimitive. Namespace imports and require("vaul") stay in place and appear in the report. Keep Vaul and its stylesheet until you have reviewed the remaining imports.

The Drawer.* namespace translates supported Vaul props onto Sheet.*. Nesting is automatic; NestedRoot remains available as an alias of Root. Check the differences below before removing Vaul.

If you want to install a fresh shadcn drawer wrapper, use the Scrollsheet registry drawer. For an existing drawer with local styling or behavior, run the codemod on your existing wrapper.

A side drawer built with Sheet, which Drawer.* maps onto. Open it and click through its sections.

vaul API Maps to
snapPoints, activeSnapPoint, direction (all 4 edges), modal={false}, onAnimationEnd, onClose, fadeFromIndex, handleOnly, snapToSequentialPoint, onRelease, preventCycle (on Drawer.Handle), asChild Mapped to scrollsheet behavior; see callback and threshold differences below
shouldScaleBackground backgroundEffect; your [data-vaul-drawer-wrapper] is picked up automatically
closeThreshold Converts Vaul’s dragged-away fraction to scrollsheet’s remaining-visible fraction, preserving Vaul’s 0.25 default. Applies only when snapPoints is unset, matching Vaul
onAnimationEnd(open) Fires once the open or close transition visually finishes, not on a timer. On native Sheet.Root the prop is onOpenChangeComplete
onClose Fires on every dismiss path (swipe, Esc, backdrop, imperative close), layered on onOpenChange. On native Sheet.Root, check open === false in onOpenChange
onPointerDownOutside / onInteractOutside with preventDefault() backdropDismissible={false} on Drawer.Root (blocks backdrop tap, keeps drag and Esc); the onEscapeKeyDown version is escapeDismissible={false}

Scrollsheet-native props with no vaul counterpart (backdropDismissible, escapeDismissible, keyboardExpands, onTravel, scrollbar, actionsRef, animationSpeed, flick, nonce) forward through Drawer.Root unchanged. You can use them without converting to Sheet.*.

data-vaul-drawer, -direction, and -snap-points still land on Drawer.Content; data-vaul-handle on Drawer.Handle, for existing selectors targeting those hooks. Title, Description, and Close get no vaul-branded attribute. data-vaul-no-drag remains an opt-out for pointer-driven dragging, including on a custom control’s ancestor; new code can use data-scrollsheet-no-drag.