A panel that slides in from an edge of the screen.
children |
ReactNode | PayloadChildRenderFunction<unknown> |
| – |
The content of the drawer. |
defaultOpen | boolean | false | Whether the drawer is initially open. To render a controlled drawer, use the |
defaultSnapPoint | DrawerSnapPoint|null | – | The initial snap point value when uncontrolled. |
defaultTriggerId | string|null | – | ID of the trigger that the drawer is associated with. This is useful in conjunction with the |
disablePointerDismissal | boolean | false | Whether to prevent the drawer from closing on outside presses. For non-modal drawers, this also prevents the drawer from closing when focus moves outside of it. |
handle | DrawerHandle<unknown> | – | A handle to associate the drawer with a trigger. If specified, allows detached triggers to control the drawer's open state. Can be created with the Drawer.createHandle() method. |
modal | boolean|"trap-focus" | true | Determines if the drawer enters a modal state when open.
|
onOpenChange | ((open: boolean, eventDetails: DrawerRootChangeEventDetails) => void) | – | Event handler called when the drawer is opened or closed. |
onOpenChangeComplete | ((open: boolean) => void) | – | Event handler called after any animations complete when the drawer is opened or closed. |
onSnapPointChange | ((snapPoint: DrawerSnapPoint | null, eventDetails: DrawerRootSnapPointChangeEventDetails) => void) | – | Callback fired when the snap point changes. |
open | boolean | – | Whether the drawer is currently open. |
position | "top"|"bottom"|"left"|"right" | bottom | The edge of the screen the drawer slides in from. Its parts follow it unless they set their own |
snapPoint | DrawerSnapPoint|null | – | The currently active snap point. Use with |
snapPoints | DrawerSnapPoint[] | – | Snap points used to position the drawer. Use numbers between 0 and 1 to represent fractions of the viewport height, numbers greater than 1 as pixel values, or strings in |
snapToSequentialPoints | boolean | false | Disables velocity-based snap skipping so drag distance determines the next snap point. |
swipeDirection | "left"|"right"|"up"|"down" | 'down' | The swipe direction used to dismiss the drawer. |
triggerId | string|null | – | ID of the trigger that the drawer is associated with. This is useful in conjunction with the |
Accepts className, style and render, plus every native attribute of the element it renders.
Accepts className, style and render, plus every native attribute of the element it renders.
Accepts className, style and render, plus every native attribute of the element it renders.
Accepts className, style and render, plus every native attribute of the element it renders.
Accepts className, style and render, plus every native attribute of the element it renders.
Accepts className, style and render, plus every native attribute of the element it renders.
Accepts render, plus every native <div> attribute.
Accepts render, plus every native <div> attribute.
Accepts className, style and render, plus every native attribute of the element it renders.
Accepts className, style and render, plus every native attribute of the element it renders.
Accepts render, plus every native <div> attribute.
Accepts render, plus every native <div> attribute.
Accepts render, plus every native <nav> attribute.
Accepts render, plus every native <button> attribute.
Accepts render, plus every native <div> attribute.
Accepts render, plus every native <div> attribute.
Accepts render, plus every native <div> attribute.
Accepts className, style and render, plus every native attribute of the element it renders.
Accepts className, style and render, plus every native attribute of the element it renders.
Accepts className, style and render, plus every native attribute of the element it renders.
Accepts className, style and render, plus every native attribute of the element it renders.
Accepts className, style and render, plus every native attribute of the element it renders.
Accepts className, style and render, plus every native attribute of the element it renders.
DrawerCreateHandle is called, not rendered. It creates a handle: pass it as handle to a trigger and to the root, and the trigger can sit anywhere in the tree, outside the root.