Skip to content

Drawer

A swipeable panel that slides in from the edge of the screen.

Install

Bash
npx @madeui/cli add drawer

Usage

TSX
import {
  Drawer,
  DrawerClose,
  DrawerContent,
  DrawerDescription,
  DrawerFooter,
  DrawerHeader,
  DrawerTitle,
  DrawerTrigger,
} from '@/components/ui/drawer';

Composition

TSX
<Drawer>
  <DrawerTrigger />
  <DrawerContent>
    <DrawerHeader>
      <DrawerTitle />
      <DrawerDescription />
    </DrawerHeader>
    <DrawerFooter>
      <DrawerClose />
    </DrawerFooter>
  </DrawerContent>
</Drawer>

Directions

swipeDirection sets which edge the drawer rests on and swipes back toward.

API reference

Built on Base UI Drawer. Swipe-to-dismiss and snap points come from the primitive — Base UI drives the swipe offsets through CSS variables that the styles consume. All props are forwarded to the Base UI Root (open, snapPoints, modal, swipeDirection, …); see the Base UI Drawer API reference.

Unlike Sheet (a fixed side panel on the Dialog primitive), Drawer is gesture-driven — prefer it on touch-first surfaces.

Drawer

PropTypeDefaultDescription
swipeDirection'down' | 'up' | 'left' | 'right''down'Edge the drawer rests on and dismisses toward.
showSwipeHandlebooleanfalseRenders a grab handle on the swipe edge.

Nested drawer stacking (scale/peek of the drawer behind) is not styled yet. Every part accepts a style prop (StyleXStyles, merged last).

Was this page helpful?