UI Drawer

GitHub

Drawer primitive with support for keeping portal content mounted.

Installation

bash
pnpm dlx shadcn@latest add @cs/ui-drawer

Usage

tsx
import { Drawer, DrawerContent, DrawerTrigger } from "@/components/cs/ui-drawer"
tsx
<Drawer>
  <DrawerTrigger render={<button type="button">Open drawer</button>} />
  <DrawerContent keepMounted>Drawer content</DrawerContent>
</Drawer>

API Reference

Drawer

Drawer primitive that supports mounted portal content after closing.

Props

NameTypeDefaultDescription
showSwipeHandlebooleanfalse-

DrawerPortal

DrawerOverlay

DrawerSwipeHandle

DrawerTrigger

DrawerClose

DrawerContent

Props

NameTypeDefaultDescription
keepMountedboolean--

DrawerHeader

DrawerFooter

DrawerTitle

DrawerDescription