Drawer

Bottom drawer that slides a sheet up from the screen edge with a titled header, close button and scrolling body, capped at 80% of the viewport height.

src/registry/ui/drawer.tsx/r/drawer.json

Installation#

bash
npx shadcn@latest add @minidev/drawer

MiniDev UI is in the shadcn registry directory, so the short form works with no setup. Older CLI versions can use the full URL: npx shadcn@latest add https://ui.minidev.pro/r/drawer.json

Usage#

tsx
import { Drawer } from "@/components/ui/drawer"

export function Example() {
  return <Drawer />
}

API reference#

Drawer props
PropTypeDefault
openboolean-
onClose() => void-
side"left" | "right" | "top" | "bottom""bottom"
titlestring-
childrenReact.ReactNode-
triggerReact.ReactNode-
classNamestring-

Dependencies#

npm

React only

Built from

All dialog, drawer and popover components

Learn more