Skip to content

Drawer ​

A drawer that slides up from the bottom. Drag it down to dismiss: release past 30% of its height or fling it down to close; otherwise it springs back.

Usage ​

Approximate web preview — the HarmonyOS rendering is the reference.

API ​

Extracted from the @Param / @Event / @BuilderParam declarations in the library sources.

SDrawer ​

shadcn-vue Drawer (vaul): a bottom panel with a drag handle that can be dragged down to dismiss.

Drag the panel down: it follows the finger; releasing past 30% of its height (or flinging down) closes it, otherwise it springs back (motion key 'drawer').

PropTypeDefaultDescription
open!!boolean | undefinedundefined
defaultOpenbooleanfalse
EventTypeDefaultDescription
onOpenChange(open: boolean) => void() => { }

Slots: children (trailing closure)

SDrawerTrigger ​

Slots: children (trailing closure)

SDrawerClose ​

Slots: children (trailing closure)

SDrawerContent ​

The drawer panel (bg-background rounded-t-lg border-t max-h-[80vh] + handle mt-4 h-2 w-[100px] rounded-full bg-muted), presented as a bottom sheet of the overlay host.

PropTypeDefaultDescription
dismissOnOutsidebooleantrue
dragToDismissbooleantrueallow drag-to-dismiss
tokensDrawerTokens{}per-instance panel tokens (instance → --drawer-* tokens → recipe), see {@link DrawerTokens}

Slots: children (trailing closure)

SDrawerHeader ​

flex flex-col gap-1.5 p-4, centred text on compact windows (shadcn: text-center md:text-left).

Slots: children (trailing closure)

SDrawerFooter ​

mt-auto flex flex-col gap-2 p-4.

Slots: children (trailing closure)

SDrawerTitle ​

PropTypeDefaultDescription
textResourceStr''

SDrawerDescription ​

PropTypeDefaultDescription
textResourceStr''

MIT Licensed