shadcn.io is not affiliated with official shadcn/ui
Sheet examples · Navigation
Navigation with Search Sheet for React
A left-side menu sheet with a search field above five page links.
A left-side menu with a search field above Home, Products, Services, Blog and Contact. The field is a search input with its own label for screen readers; filter the links, or send the query to your site search.
Preview
Installation
FAQ
Does the search field filter the links?
Not in this demo: the input is uncontrolled and the links are static. Keep the query in state and show only the links that contain it, or submit it to your search page.
How is the search field labeled?
It has aria-label="Search menu" and type="search", since no visible label sits above it. The placeholder isn't a label: it disappears as people type.
Which links does the menu have?
Home, Products, Services, Blog and Contact, as a elements in a nav, mapped from a static list.
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
- Simple Command DialogA button that opens a command dialog with
- Search and Filter SheetA right-side filter sheet with a search
- Simple Single Select ComboboxA single-select combobox that opens from
- Sidebar Navigation SheetA left-side navigation sheet with