Drawer

Edge-anchored dialog panel that slides in from a screen edge with CSS-only enter/exit motion

Category: overlay · WCAG 2.2-AA · overlay, drawer, panel, slide, dialog

States

Props

PropTypeDefaultDescription
openbooleanWhether the component is open (controlled).
defaultOpenbooleanWhether the component is open on first render (uncontrolled).
onOpenChange(open: boolean) => voidCalled with the next open state when it changes.
side'start' | 'end' | 'top' | 'bottom'endEdge the panel is anchored to. Drives the slide direction.
sizestringPanel size along its cross axis (width for start/end, height for top/bottom).
titleReact.ReactNodeTitle text for the component.
descriptionReact.ReactNodeSupporting description text.
childrenReact.ReactNodeContent rendered inside the component.
labels{ close?: string }Overrides for the component’s user-visible strings (i18n).
classNamestringAdditional CSS class names merged onto the root element.
swipeToDismissbooleanfalseAllow dragging the header toward its edge to dismiss (opt-in).

Design tokens

When to use

When not to use

How to build an accessible Drawer in React →

Examples

Basic

<Drawer open={isOpen} onOpenChange={setIsOpen} title="Settings">
  <SettingsForm />
</Drawer>

Bottom drawer with swipe-to-dismiss

Dragging the header past a threshold toward the edge dismisses the panel.

<Drawer defaultOpen side="bottom" size="20rem" swipeToDismiss title="Details">
  <OrderDetails />
</Drawer>

Related components

← Back to docs