shadcn.io is not affiliated with official shadcn/ui
Sheet examples · Standard
Left-Sided Sheet for React
A sheet that slides in from the left edge of the screen with a title and a description.
side="left" on SheetContent is the whole difference: the panel slides in from the left, and the title, the focus trap and Escape work as on every other edge. Use it for navigation and filters, where people expect a panel to come from the start of the page. The demo holds only the header, so put your own body under it.
Preview
Installation
FAQ
How do I open the sheet from the left?
Set side="left" on SheetContent. Leave it out and the sheet opens from the right. It takes top, right, bottom or left.
How wide is the left sheet?
A left sheet fills the height and caps its width from the sm breakpoint. Change the cap with a class such as data-[side=left]:sm:max-w-md on SheetContent.
What does the left sheet announce?
SheetTitle names the dialog for assistive tech, so every sheet renders one; hide it with sr-only when the design has no visible heading. Here it reads Left Sheet, and SheetDescription reads This sheet slides in from the left side of the screen.
How is Open Sheet connected?
The button labeled Open Sheet is the trigger, and its text is the accessible name.
The Button goes in the render prop of SheetTrigger, and the label stays its child.
Related
- Mobile Menu SheetA left-side menu sheet with four page
- Sheet with Title and DescriptionA right-side sheet whose header holds a
- Bottom-Sliding SheetA sheet that slides up from the bottom of
- Sidebar Navigation SheetA left-side navigation sheet with
- Top-Sliding SheetA sheet that slides down from the top of
- Article Preview SheetA right-side sheet previewing an article