Drawer
A panel that slides from an edge.
Upstream documentationExamples
Installation
Run the Ninaero registry command to install the component and its dependencies, including shared theme styles.
Install Drawer
pnpm dlx shadcn@latest add 'https://ninaero.pages.dev/r/drawer.json'Usage
A complete example using the installed component and hook paths.
Drawer usage
"use client";import { Button } from "@/components/ui/button";import { Drawer, DrawerClose, DrawerContent, DrawerDescription, DrawerFooter, DrawerHeader, DrawerTitle, DrawerTrigger } from "@/components/ui/drawer";function DrawerPreview() { return ( <Drawer> <DrawerTrigger render={<Button variant="outline" />}>Open drawer</DrawerTrigger> <DrawerContent> <DrawerHeader> <DrawerTitle>Example drawer</DrawerTitle> <DrawerDescription>A panel with some sample details.</DrawerDescription> </DrawerHeader> <DrawerFooter> <DrawerClose render={<Button variant="outline" />}>Close</DrawerClose> </DrawerFooter> </DrawerContent> </Drawer> );}export default function Demo() { return <DrawerPreview />;}API Reference
Ninaero exports and local defaults are listed below. See the upstream reference for inherited primitive props and additional composition examples.
Drawer
Drawer props
DrawerPrimitive.Root.Props & { showSwipeHandle?: boolean;}- modal
- true
- showSwipeHandle
- false
- swipeDirection
- "down"
DrawerPortal
DrawerPortal props
DrawerPrimitive.Portal.PropsDrawerOverlay
DrawerOverlay props
DrawerPrimitive.Backdrop.PropsDrawerSwipeHandle
DrawerSwipeHandle props
React.ComponentProps<"div">DrawerTrigger
DrawerTrigger props
DrawerPrimitive.Trigger.PropsDrawerClose
DrawerClose props
DrawerPrimitive.Close.PropsDrawerContent
DrawerContent props
DrawerPrimitive.Popup.PropsDrawerHeader
DrawerHeader props
React.ComponentProps<"div">DrawerFooter
DrawerFooter props
React.ComponentProps<"div">DrawerTitle
DrawerTitle props
DrawerPrimitive.Title.PropsDrawerDescription
DrawerDescription props
DrawerPrimitive.Description.Props