← All Components

Drawer

Slide-in panel from the left or right edge. Built on Vaul.

Right (default)

Left

Sub-components

ComponentPropsDescription
Drawerdirection, open, onOpenChangeRoot container (wraps vaul)
Drawer.TriggerasChild, childrenElement that opens the drawer
Drawer.ContentclassName, childrenThe slide-in panel
Drawer.HeaderclassName, childrenTop section inside the panel
Drawer.FooterclassName, childrenBottom section inside the panel
Drawer.TitleclassName, childrenAccessible title for the drawer
Drawer.DescriptionclassName, childrenAccessible description
Drawer.CloseasChild, childrenElement that closes the drawer

Usage

<Drawer direction="right"> <Drawer.Trigger asChild> <Button>Open</Button> </Drawer.Trigger> <Drawer.Content> <Drawer.Header> <Drawer.Title>Title</Drawer.Title> </Drawer.Header> <div className="p-4">Content here</div> <Drawer.Footer> <Drawer.Close asChild> <Button variant="outline">Close</Button> </Drawer.Close> </Drawer.Footer> </Drawer.Content> </Drawer>