Skip to content

Drawer

Slides an interactive panel in from the edge of the screen, giving users quick access to secondary tools, forms, or menus with swipe gestures.

23.1 KB
•
Updated on September 20, 2026

Installation

Bash

Usage

Code
Code

Anatomy

Code

Features

Positions

Drawer positioned along different screen edges (position="bottom" | "top" | "left" | "right").

Accessibility

  • Traps focus within the drawer panel while open and locks background scroll.
  • Supports physical swipe-down gestures and keyboard escape dismissal.

Keyboard Interactions

Inset Variant

Drawer configured with inset margins across all four edge positions.

Straight Variant

Standard full-bleed straight drawer without rounded inset margins.

API Reference

Drawer

Root component. Wraps Drawer.Root from Base UI with automatic swipeDirection mapping based on position.

All other props from Drawer.Root are supported, including open, onOpenChange, modal, snapPoints, snapPoint, onSnapPointChange, and snapToSequentialPoints. Note: Snap points only work for bottom drawers.

DrawerCreateHandle

Creates a handle for detached drawer triggers. Use it when triggers and drawer content need to be coordinated across different parts of the tree.

DrawerTrigger

Trigger button that opens the drawer. Alias for Drawer.Trigger from Base UI.

DrawerPopup

Popup container that displays the drawer content.

Example:

Code

DrawerHeader

Container for the drawer title and description. Supports the render prop for polymorphic composition (e.g. render={<header />}).

DrawerFooter

Footer section for action buttons. Supports the render prop for polymorphic composition.

DrawerTitle

Title component. Alias for Drawer.Title from Base UI.

DrawerDescription

Description component. Alias for Drawer.Description from Base UI.

DrawerPanel

Content container. When scrollable is true (default), wraps content in a ScrollArea component. Supports the render prop for polymorphic composition.

DrawerMenu

Container for drawer menu items. Use with DrawerMenuItem, DrawerMenuSeparator, DrawerMenuGroup, DrawerMenuGroupLabel, DrawerMenuCheckboxItem, DrawerMenuRadioGroup, DrawerMenuRadioItem, and DrawerMenuTrigger to build menus that mirror the Menu component API. Supports the render prop for polymorphic composition.

DrawerMenuItem

Styled menu item that matches MenuItem appearance. Does not close the drawer — wrap with DrawerClose when close-on-click is needed. Supports the render prop for polymorphic composition.

Example: Use with DrawerClose for close-on-click: <DrawerClose render={<DrawerMenuItem />}>Edit</DrawerClose>

DrawerMenuSeparator

Horizontal separator between menu items or groups. Supports the render prop for polymorphic composition.

DrawerMenuGroup

Container for grouping related menu items. Use with DrawerMenuGroupLabel for labeled sections. Supports the render prop for polymorphic composition.

DrawerMenuGroupLabel

Label for a DrawerMenuGroup section. Renders muted, smaller text above a group of items. In nested drawers, use as a section title at the top of the menu (no back button needed — swipe to go back). Supports the render prop for polymorphic composition.

DrawerMenuTrigger

Trigger that opens a nested drawer. Styled like a menu item with a trailing chevron. Use for menu items that open nested drawers (e.g. "Add to Playlist" → nested drawer with playlist options). Wraps DrawerTrigger internally.

Example: <DrawerMenuTrigger>Add to Playlist</DrawerMenuTrigger> opens a nested drawer when tapped.

DrawerMenuCheckboxItem

Checkbox menu item for independent toggles. Supports variant="switch" for toggle-style switches, checked, defaultChecked, and onCheckedChange. For selection groups, use DrawerMenuRadioGroup with DrawerMenuRadioItem.

DrawerMenuRadioGroup

Container for radio menu items. Use with DrawerMenuRadioItem for mutually exclusive options (e.g. "Sort by" with Artist, Album, Title).

DrawerMenuRadioItem

Radio menu item. Must be used inside DrawerMenuRadioGroup with a value prop.

DrawerClose

Close button component. Alias for Drawer.Close from Base UI.

DrawerPortal

Portal component for rendering outside the DOM hierarchy. Alias for Drawer.Portal from Base UI.

DrawerBackdrop

Backdrop/overlay component. Alias for Drawer.Backdrop from Base UI.

DrawerViewport

Viewport component for positioning. Alias for Drawer.Viewport from Base UI. Typically not used directly — DrawerPopup renders it internally.

DrawerBar

Drag handle indicator shown when showBar is true on DrawerPopup. Typically not used directly.

DrawerContent

Primitive content wrapper used for polymorphic composition with the render prop. Alias for Drawer.Content from Base UI.

Examples

Drawer with close button
Scrollable content with terms and conditions
Nested bottom drawers with centered content
Nested right drawers with inset variant
Bottom drawer with snap points
Mobile menu drawer from the left
Responsive edit profile: dialog on desktop, drawer on mobile
Responsive actions menu: menu on desktop, drawer on mobile
Left drawer with swipe area