Skip to content
UI

Search docs

Search components and documentation

New
Menu

Drawer

Extends the Dialog component to display content sliding in from an edge with a drag handle.

Installation

npx logic2b@latest add drawer

Usage

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

<Drawer>
  <DrawerTrigger>Open</DrawerTrigger>
  <DrawerContent>
    <DrawerHeader>
      <DrawerTitle>Edit profile</DrawerTitle>
      <DrawerDescription>Make changes to your profile here.</DrawerDescription>
    </DrawerHeader>
    <DrawerFooter>
      <DrawerClose>Cancel</DrawerClose>
    </DrawerFooter>
  </DrawerContent>
</Drawer>

Built on vaul. Unlike sheet, which is a plain Radix Dialog sliding in from an edge, drawer supports drag-to-dismiss and snap points — better suited for mobile bottom sheets.

API

Prop Type Default
direction (Drawer) top | bottom | left | right bottom
shouldScaleBackground (Drawer) boolean
open / onOpenChange (Drawer) boolean / (open: boolean) => void
snapPoints (Drawer) (number | string)[]

Examples

Right Direction

Scrollable Content

Accessibility

  • Extends Radix Dialog via vaul, so focus is trapped while open and restored to the trigger on close.
  • Provide a DrawerTitle (and ideally a DrawerDescription) so screen readers announce the drawer — vaul wires them up as the accessible name/description.
  • Dismissable with Escape, an overlay click, or a drag/swipe toward the edge it slides in from.