Drawer
A panel that slides in from an edge. Built on Vaul. For RTL-safe side panels, prefer direction="start" / "end" — SonoJS resolves them to physical sides so Vaul's animation matches the visual edge.
Basic
Pick a delivery time — side drawer on desktop, bottom on mobile.
Installation
CLI
Also needs
npx @sonojs/ui@latest add sonner && npm i sonner vaulDirection (RTL / LTR)
Vaul only understands physical left / right. SonoJS maps start / end with resolveEdgeSide before opening, and sets dir on the portaled content so text stays correct.
direction.tsx
Composition
structure
Usage
drawer.tsx
Props
| Prop | Type | Default | Description |
|---|---|---|---|
| direction | "top" · "bottom" · "left" · "right" · "start" · "end" | "bottom" | On Drawer — prefer start/end for RTL. left/right are physical and do not flip. |
| open / onOpenChange | boolean / (open: boolean) => void | — | On Drawer — controlled open state. |
| asChild | boolean | false | On DrawerTrigger / DrawerClose — merge props into the child (e.g. Button). |
| shouldScaleBackground | boolean | true | On Drawer — Vaul scales the page behind the drawer. |