Drawer

Bottom-anchored pull-up built on vaul-svelte. Drag the handle to dismiss, scale-fades the page behind, springs back when released short of the threshold.

Usage

Responsive dialog

Drawer on mobile, Dialog on desktop — same content, breakpoint-switched via matchMedia. Resize the window to see it swap.

Mobile navigation

A single drawer with internal page routing — content slides horizontally between pages using motion.dev animate(). vaul handles vertical drag-to-dismiss; a $effect drives the x-axis transition on page change. Reset to the root page on drawer close.

Snap points

Pass snapPoints as fractions or pixel strings. The drawer rests at each stop; drag past the last to dismiss.

Nested drawers

Use Drawer.NestedRoot inside any Drawer.Content to stack a second drawer on top.

Scrollable content

Wrap the body in a ScrollArea with a height cap — the drag handle and footer stay anchored, only the inner list scrolls.

Drawer.Root props

Inherits vaul-svelte Drawer.Root props via spread.

PropTypeDescription
boolean (bindable)Visibility, two-way bindable.
booleanScales the page body back as the drawer rises, for a stacked-card feel.
string | number | null (bindable)Currently active snap point when snapPoints are configured.
(string | number)[]Optional fractions or px values that the drawer can rest at.