shadcn.io is not affiliated with official shadcn/ui
Sheet examples · Navigation
Mobile Menu Sheet for React
A left-side menu sheet with four page links stacked under a Menu title.
The simplest mobile menu: a left-side sheet titled Menu with Home, Products, About and Contact in a nav. Show the trigger on small screens and your regular navigation on larger ones.
Preview
Installation
FAQ
Which links does the menu have?
Home, Products, About and Contact, as a elements in a nav, mapped from a static list. Swap href="#" for your routes, or use your router's link.
Why does the menu open from the left?
side="left" on SheetContent slides the panel in from the left, where people look for a menu. It fills the height and caps its width from the sm breakpoint.
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.
How do I show it only on small screens?
Hide the trigger from the md breakpoint up, with md:hidden, and show your full navigation there instead.
Related
- Sidebar Navigation SheetA left-side navigation sheet with
- Navigation with Search SheetA left-side menu sheet with a search
- Nested Navigation Menu SheetA left-side menu sheet with Products and
- Simple Navigation Navigation MenuA navigation menu with Products and
- Navigation with User Profile SheetA left-side menu sheet with the signed-in
- Article Preview SheetA right-side sheet previewing an article