Search documentation

Search the documentation and open a page.

A panel that slides in from the edge of the screen and can be dismissed by dragging or interacting with a control.

Loading...

Installation

pnpm dlx shadcn@latest add @wirekyt/drawer

Composition

Drawer ├── DrawerTrigger └── DrawerContent ├── DrawerHandle (optional) ├── DrawerHeader │ ├── DrawerTitle │ └── DrawerDescription ├── DrawerBody ├── DrawerFooter (optional) └── DrawerClose

Examples

Account

Loading...

Automation

Loading...

Default

Loading...

Meetings

Loading...

Notifications

Loading...

Sprint

Loading...

Step Goal

Loading...

API Reference

Drawer

PropTypeDefaultDescription
idstring | undefined—Unique identifier used to connect the component parts.
idsElementIds—Overrides generated identifiers for individual parts.
trapFocusboolean | undefined—Configures trap focus.
preventScrollboolean | undefined—Configures prevent scroll.
modalboolean | undefined—Configures modal.
initialFocusEl(() => MaybeElement) | undefined—Configures initial focus el.
finalFocusEl(() => MaybeElement) | undefined—Configures final focus el.
restoreFocusboolean | undefined—Configures restore focus.
role"dialog" | "alertdialog" | undefined—Configures role.
triggerValuestring | null | undefined—Configures trigger value.
defaultTriggerValuestring | null | undefined—Configures default trigger value.
onTriggerValueChange((details: TriggerValueChangeDetails) => void) | undefined—Runs when trigger value changes.
openboolean | undefined—Whether the component is open when controlled.
defaultOpenboolean | undefined—Initial open state when uncontrolled.
onOpenChange((details: OpenChangeDetails) => void) | undefined—Runs when open changes.
closeOnInteractOutsideboolean | undefinedtrueConfigures close on interact outside.
closeOnEscapeboolean | undefinedtrueConfigures close on escape.
snapPointsSnapPoint[] | undefined—Configures snap points.
swipeDirectionSwipeDirection | undefined—Configures swipe direction.
snapToSequentialPointsboolean | undefined—Configures snap to sequential points.
swipeVelocityThresholdnumber—Configures swipe velocity threshold.
closeThresholdnumber—Configures close threshold.
preventDragOnScrollboolean—Configures prevent drag on scroll.
snapPointSnapPoint | null | undefined—Configures snap point.
defaultSnapPointSnapPoint | null | undefined—Configures default snap point.
onSnapPointChange((details: SnapPointChangeDetails) => void) | undefined—Runs when snap point changes.
stackDrawerStack | undefined—Configures stack.

Context, Hooks, and Types

ExportAPI
DrawerContextRender-prop component that exposes component state and actions.
DrawerRootProviderProvides an externally created API to the component tree.
useDrawerCreates or accesses the component API.
useDrawerContextReturns the nearest component API.
DrawerOpenChangeDetailsType for the details object passed to the matching change callback.