shadcn.io is not affiliated with official shadcn/ui
Sheet examples · Navigation
Sidebar Navigation Sheet for React
A left-side navigation sheet with Dashboard and Settings groups, each heading over two indented links.
Sidebar navigation for small screens: a left-side sheet with a Dashboard group (Overview, Analytics) and a Settings group (Profile, Account). Each heading sits over its links, indented on the reading side with ps-4.
Preview
Installation
FAQ
How are the groups built?
From a static array: each group has a title, rendered as an h3, and its links. The nav lays the groups out in a column with gap-4.
How do I mark the current page?
Set aria-current="page" on the link for the page people are on and style it, for example with aria-[current=page]:text-foreground.
How are the links indented?
Each link has ps-4, padding on the start side, so the indent mirrors in right-to-left layouts.
Does the sheet close when a link is clicked?
Links in a sheet don't close it. When a link changes the page, close the sheet in its click handler, or let your router's navigation unmount it. To close it from code, control the open state:
Pass open to Sheet; onOpenChange receives the next boolean.
Related
- Mobile Menu SheetA left-side menu sheet with four page
- Nested Navigation Menu SheetA left-side menu sheet with Products and
- Navigation with User Profile SheetA left-side menu sheet with the signed-in
- Standard Accordion with ChevronA bordered accordion of three questions
- Simple Navigation Navigation MenuA navigation menu with Products and
- Navigation with Search SheetA left-side menu sheet with a search