UI.MD

Drawer

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

Installation

$
npx shadcn@latest add https://ui.mattdowney.com/r/drawer.json

Usage

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

Examples

Default

API Reference

PropTypeDefaultDescription
sideDrawerContent"top" | "right" | "bottom" | "left""right"Edge of the screen the drawer slides in from.
sizeDrawerContent"sm" | "md" | "lg" | "xl" | "2xl""sm"Maximum width of the panel for left/right drawers; top/bottom drawers span the full width.
showCloseButtonDrawerContentbooleantrueShows the X close button in the top corner.
showCancelButtonDrawerFooterbooleanfalseAppends a ghost Cancel button that closes the drawer.