A panel that slides in from the edge of the screen and can be dismissed by dragging or interacting with a control.
Loading...
Installation
Install the following dependencies:
Copy and paste the following code into your project.
Loading...
Update the import paths to match your project setup.
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
| Prop | Type | Default | Description |
|---|---|---|---|
id | string | undefined | — | Unique identifier used to connect the component parts. |
ids | ElementIds | — | Overrides generated identifiers for individual parts. |
trapFocus | boolean | undefined | — | Configures trap focus. |
preventScroll | boolean | undefined | — | Configures prevent scroll. |
modal | boolean | undefined | — | Configures modal. |
initialFocusEl | (() => MaybeElement) | undefined | — | Configures initial focus el. |
finalFocusEl | (() => MaybeElement) | undefined | — | Configures final focus el. |
restoreFocus | boolean | undefined | — | Configures restore focus. |
role | "dialog" | "alertdialog" | undefined | — | Configures role. |
triggerValue | string | null | undefined | — | Configures trigger value. |
defaultTriggerValue | string | null | undefined | — | Configures default trigger value. |
onTriggerValueChange | ((details: TriggerValueChangeDetails) => void) | undefined | — | Runs when trigger value changes. |
open | boolean | undefined | — | Whether the component is open when controlled. |
defaultOpen | boolean | undefined | — | Initial open state when uncontrolled. |
onOpenChange | ((details: OpenChangeDetails) => void) | undefined | — | Runs when open changes. |
closeOnInteractOutside | boolean | undefined | true | Configures close on interact outside. |
closeOnEscape | boolean | undefined | true | Configures close on escape. |
snapPoints | SnapPoint[] | undefined | — | Configures snap points. |
swipeDirection | SwipeDirection | undefined | — | Configures swipe direction. |
snapToSequentialPoints | boolean | undefined | — | Configures snap to sequential points. |
swipeVelocityThreshold | number | — | Configures swipe velocity threshold. |
closeThreshold | number | — | Configures close threshold. |
preventDragOnScroll | boolean | — | Configures prevent drag on scroll. |
snapPoint | SnapPoint | null | undefined | — | Configures snap point. |
defaultSnapPoint | SnapPoint | null | undefined | — | Configures default snap point. |
onSnapPointChange | ((details: SnapPointChangeDetails) => void) | undefined | — | Runs when snap point changes. |
stack | DrawerStack | undefined | — | Configures stack. |
Context, Hooks, and Types
| Export | API |
|---|---|
DrawerContext | Render-prop component that exposes component state and actions. |
DrawerRootProvider | Provides an externally created API to the component tree. |
useDrawer | Creates or accesses the component API. |
useDrawerContext | Returns the nearest component API. |
DrawerOpenChangeDetails | Type for the details object passed to the matching change callback. |
Angular
React
Solid
Svelte
Vue