Drawer

React drawer that slides in from the inline start, inline end, or bottom for settings, detail panels, and filter forms. Same focus handling as Modal, RTL-aware sides.

Drawer slides a panel from the screen edge, with the same focus and ESC behavior as Modal. side is logical, so start/end flip with direction.

When to use

Use Drawer for secondary flows that need more room than a Modal: editing settings, viewing a record's details, or a filter form. Use the bottom sheet on mobile for short pickers.

Because side is logical, start and end swap in RTL. Keep the page behind it visible so users keep their context.

Examples

Settings drawer

Bottom sheet

Filter form (Arabic)

Props

Props declared by Drawer. Native attributes of the underlying element pass through.

<Drawer>

PropTypeDefaultDescription
childrenReactNode
openboolean
defaultOpenboolean
onOpenChange(open: boolean) => void
modalboolean

<DrawerTrigger>

PropTypeDefaultDescription
asChildboolean

<DrawerClose>

PropTypeDefaultDescription
asChildboolean

<DrawerContent>

PropTypeDefaultDescription
side"start" | "end" | "top" | "bottom"
size"sm" | "md" | "lg" | "full"
showCloseButtonbooleanShow the corner X close button. Defaults to true.
closeLabelstringLocalized aria-label for the close button. Defaults to "Close".
forceMounttrueUsed to force mounting when more control is needed. Useful when controlling animation with React animation libraries.
onOpenAutoFocus(event: Event) => voidEvent handler called when auto-focusing on open. Can be prevented.
onCloseAutoFocus(event: Event) => voidEvent handler called when auto-focusing on close. Can be prevented.
deferPointerDownOutsidebooleanWhen true, a 'pointerdown' event outside of the layered element will wait for the interaction's click event before dispatching, allowing third-party code to stop propagation of later events and cancel dismissal.
onEscapeKeyDown(event: KeyboardEvent) => voidEvent handler called when the escape key is down. Can be prevented.
onPointerDownOutside(event: PointerDownOutsideEvent) => voidEvent handler called when the a pointerdown event happens outside of the DismissableLayer. Can be prevented.
onFocusOutside(event: FocusOutsideEvent) => voidEvent handler called when the focus moves outside of the DismissableLayer. Can be prevented.
onInteractOutside(event: PointerDownOutsideEvent | FocusOutsideEvent) => voidEvent handler called when an interaction happens outside the DismissableLayer. Specifically, when a pointerdown event happens outside or focus moves outside of it. Can be prevented.
asChildboolean

<DrawerTitle>

PropTypeDefaultDescription
asChildboolean

<DrawerDescription>

PropTypeDefaultDescription
asChildboolean

Accessibility

Drawer is built on the same Dialog base as Modal: focus is trapped inside, Escape closes it, and focus returns to the trigger. Title and description parts give the panel its accessible name.

The close button has an accessible name, and the panel follows the page direction so it slides in from the expected edge.