swipeDirection sets the side. Always render a DrawerTitle, and put long content in DrawerBody.
The sample also uses Button. One command adds them with this item:
filters-drawer.tsx
Drawer
| Prop | Type | Default | Description | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
From Base UIDrawer.RootBase UI docs | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| open | boolean | — | Whether the drawer is currently open. | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| default | boolean | false | Whether the drawer is initially open. To render a controlled drawer, use the open prop instead. | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| modal | "trap-focus" | boolean | true | Determines if the drawer enters a modal state when open. - true: user interaction is limited to just the drawer: focus is trapped, document page scroll is locked, and pointer interactions on outside elements are disabled. - false: user interaction with the rest of the document is allowed. - 'trap-focus': focus is trapped inside the drawer, but document page scroll is not locked and pointer interactions outside of it remain enabled. | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
DrawerProvider
| Prop | Type | Default | Description |
|---|---|---|---|
From Base UIDrawer.ProviderBase UI docs | |||
| children | ReactNode | — | |
DrawerVirtualKeyboardProvider
| Prop | Type | Default | Description |
|---|---|---|---|
From Base UIDrawer.VirtualKeyboardProviderBase UI docs | |||
| children | ReactNode | — | |
DrawerIndentBackground
<div>| Prop | Type | Default | Description |
|---|---|---|---|
| class | string | — | |
| ...props | <div> attributes | — | Every other attribute goes to the <div>, with a ref. |
DrawerIndent
<div>| Prop | Type | Default | Description |
|---|---|---|---|
| class | string | — | |
| ...props | <div> attributes | — | Every other attribute goes to the <div>, with a ref. |
DrawerTrigger
<button>| Prop | Type | Default | Description | ||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| class | string | — | |||||||||||||||||||
From Base UIDrawer.TriggerBase UI docs | |||||||||||||||||||||
| handle | DrawerHandle<Payload> | — | A handle to associate the trigger with a drawer. Can be created with the Drawer.createHandle method. | ||||||||||||||||||
| payload | Payload | — | A payload to pass to the drawer when it is opened. | ||||||||||||||||||
| id | string | — | ID of the trigger. In addition to being forwarded to the rendered element, it is also used to specify the active trigger for drawers in controlled mode (with the Drawer.Root triggerId prop). | ||||||||||||||||||
| |||||||||||||||||||||
| ...props | <button> attributes | — | Every other attribute goes to the <button>, with a ref. | ||||||||||||||||||
DrawerSwipeArea
<div>| Prop | Type | Default | Description | |||||||
|---|---|---|---|---|---|---|---|---|---|---|
| class | string | — | ||||||||
From Base UIDrawer.SwipeAreaBase UI docs | ||||||||||
| disabled | boolean | false | Whether the swipe area is disabled. | |||||||
| swipe | "down""left""right""up" | — | The swipe direction that opens the drawer. Defaults to the opposite of Drawer.Root swipeDirection. | |||||||
| render | — | Allows you to replace the component's HTML element with a different tag, or compose it with another component. Accepts a ReactElement or a function that returns the element to render. | ||||||||
| ||||||||||
| ...props | <div> attributes | — | Every other attribute goes to the <div>, with a ref. | |||||||
DrawerSwipeHandle
<div>| Prop | Type | Default | Description |
|---|---|---|---|
| ...props | <div> attributes | — | Every other attribute goes to the <div>, with a ref. |
DrawerPortal
<div>| Prop | Type | Default | Description |
|---|---|---|---|
From Base UIDrawer.PortalBase UI docs | |||
| keep | boolean | false | Whether to keep the portal mounted in the DOM while the popup is hidden. |
| container | — | A parent element to render the portal element into. | |
| class | — | CSS class applied to the element, or a function that returns a class based on the component's state. | |
| ...props | <div> attributes | — | Every other attribute goes to the <div>, with a ref. |
DrawerOverlay
<div>| Prop | Type | Default | Description |
|---|---|---|---|
| class | string | — | |
From Base UIDrawer.BackdropBase UI docs | |||
| force | boolean | false | Whether the backdrop is forced to render even when nested. |
| render | — | Allows you to replace the component's HTML element with a different tag, or compose it with another component. Accepts a ReactElement or a function that returns the element to render. | |
| style | — | Style applied to the element, or a function that returns a style object based on the component's state. | |
| ...props | <div> attributes | — | Every other attribute goes to the <div>, with a ref. |
DrawerContent
<div>| Prop | Type | Default | Description |
|---|---|---|---|
| class | string | — | |
| backdrop | boolean | true | Dim the page under the drawer (Base UI Drawer.Backdrop). Default true. |
| show | boolean | true | Show the grab bar on bottom and top sheets. Default true. |
| show | boolean | false | Show the close button (a 24px ghost icon button) in the top end corner. Default false. |
| close | string | "Close" | The accessible name of the close button. Translate it with the page. |
| portal | — | Other Base UI props of the inner parts. A className here adds to the component classes. | |
| backdrop | DrawerOverlayProps | — | |
| viewport | — | ||
| close | — | ||
From Base UIDrawer.PopupBase UI docs | |||
| initial | — | Determines the element to focus when the drawer is opened. - false: Do not move focus. - true: Move focus based on the default behavior (first tabbable element or popup). - RefObject: Move focus to the ref element. - function: Called with the interaction type (mouse, touch, pen, or keyboard). Return an element to focus, true to use the default behavior, or false/undefined to do nothing. | |
| final | — | Determines the element to focus when the drawer is closed. - false: Do not move focus. - true: Move focus based on the default behavior (trigger or previously focused element). - RefObject: Move focus to the ref element. - function: Called with the interaction type (mouse, touch, pen, or keyboard). Return an element to focus, true to use the default behavior, or false/undefined to do nothing. | |
| container | — | A parent element to render the portal element into. | |
| ...props | <div> attributes | — | Every other attribute goes to the <div>, with a ref. |
DrawerBody
<div>| Prop | Type | Default | Description |
|---|---|---|---|
| class | string | — | |
| ...props | <div> attributes | — | Every other attribute goes to the <div>, with a ref. |
DrawerHeader
<div>| Prop | Type | Default | Description |
|---|---|---|---|
| ...props | <div> attributes | — | Every other attribute goes to the <div>, with a ref. |
DrawerTitle
<div>| Prop | Type | Default | Description |
|---|---|---|---|
| class | string | — | |
| ...props | <div> attributes | — | Every other attribute goes to the <div>, with a ref. |
DrawerDescription
<div>| Prop | Type | Default | Description |
|---|---|---|---|
| class | string | — | |
| ...props | <div> attributes | — | Every other attribute goes to the <div>, with a ref. |
DrawerFooter
<div>| Prop | Type | Default | Description |
|---|---|---|---|
| ...props | <div> attributes | — | Every other attribute goes to the <div>, with a ref. |
DrawerClose
<div>| Prop | Type | Default | Description |
|---|---|---|---|
| class | string | — | |
| ...props | <div> attributes | — | Every other attribute goes to the <div>, with a ref. |
| EnterorSpace | On the trigger, opens the drawer. |
|---|---|
| Tab | Moves focus between the elements in the drawer. With the default modal, focus stays inside. |
| Escape | Closes the drawer. |
- DialogPick Dialog for a centered task on a desktop page, with no drag and no edge.
- PopoverPick Popover for a small panel next to its button, not a panel from an edge of the screen.
- Alert DialogA window that asks a yes or no question before an action that deletes data or cannot be undone. The page waits until the person answers.





