Drawer
A panel that slides in from an edge of the screen.
Updated
Bottom drawer
<Drawer>
<DrawerTrigger asChild><Button variant="outline">Open drawer</Button></DrawerTrigger>
<DrawerContent>
<DrawerHeader>
<DrawerTitle>Move goal</DrawerTitle>
<DrawerDescription>Set your daily activity goal.</DrawerDescription>
</DrawerHeader>
<DrawerFooter>
<Button>Submit</Button>
<DrawerClose asChild><Button variant="outline">Cancel</Button></DrawerClose>
</DrawerFooter>
</DrawerContent>
</Drawer>A panel that slides in from an edge of the screen.
Installation
railbase ui add drawer
Note
railbase ui add also copies shared primitives — they ship alongside this component automatically.
Usage
import { Drawer, DrawerTrigger, DrawerContent, DrawerHeader, DrawerTitle, DrawerDescription, DrawerFooter, DrawerClose } from "@/lib/ui/drawer";
<Drawer>
<DrawerTrigger>Open</DrawerTrigger>
<DrawerContent>
<DrawerHeader>
<DrawerTitle>Title</DrawerTitle>
<DrawerDescription>Description.</DrawerDescription>
</DrawerHeader>
<DrawerFooter><DrawerClose>Close</DrawerClose></DrawerFooter>
</DrawerContent>
</Drawer>
Anatomy
Exported parts: Drawer · DrawerTrigger · DrawerClose · DrawerPortal · DrawerOverlay · DrawerContent · DrawerHeader · DrawerFooter · DrawerTitle · DrawerDescription