Prodular UI

Drawer

A swipeable panel from the bottom or side of the screen, built for touch, with snap points and nested drawers.

npx prodular-ui add drawer

Bottom

The default. Shows a swipe handle and dismisses with a downward swipe.

Side

swipeDirection right turns it into a side panel that closes with a swipe.

Anatomy

<Drawer showSwipeHandle>  <DrawerTrigger render={<Button variant="outline" />}>Move deal</DrawerTrigger>  <DrawerContent>    <DrawerHeader>      <DrawerTitle>Move deal</DrawerTitle>      <DrawerDescription>Pick the stage this deal is in now.</DrawerDescription>    </DrawerHeader>    <DrawerBody>{/* options */}</DrawerBody>    <DrawerFooter>      <DrawerClose render={<Button />}>Done</DrawerClose>    </DrawerFooter>  </DrawerContent></Drawer>

Guidance

Use it when

  • Use on mobile and touch first surfaces for pickers, filters and short forms.
  • Use showSwipeHandle on bottom drawers so people know they can swipe it away.
  • Use snapPoints when the drawer has a peek state and a full state.

Avoid

  • Desktop editing flows. Use Sheet, which has no swipe physics.
  • Long forms. Content taller than the viewport fights with the swipe gesture.

Rules for AI agents

Published in llms-full.txt, the registry and the MCP server, so coding agents follow them when they build with this component.

  • Always render DrawerTitle inside DrawerHeader.
  • Set swipeDirection on Drawer, not on DrawerContent. down is the default.
  • Compose as DrawerHeader, DrawerBody, DrawerFooter. Put scrolling content in DrawerBody.
  • On bottom drawers, constrain the inner content with mx-auto max-w-md so it reads well on tablets.

API

Drawer

PropTypeDefaultDescription
swipeDirection"down" | "up" | "left" | "right""down"Direction that dismisses the drawer. Also sets the edge it opens from.
showSwipeHandlebooleanfalseRenders the grab handle.
snapPoints(number | string)[]Heights the drawer settles at.
modalbooleantrueShows the backdrop and traps focus.

Installation

The Prodular UI CLI adds the source to components/ui with everything it depends on. In a project that already uses shadcn/ui, the shadcn CLI installs it from the Prodular registry too. See Installation for the first setup.

npx prodular-ui add drawer# or, with the registry in components.jsonnpx shadcn@latest add @prodular/drawer