shadcn.io is not affiliated with official shadcn/ui
Sheet examples · Form
Search and Filter Sheet for React
A right-side filter sheet with a search field, three category checkboxes and an Apply Filters button.
Filters that slide in from the right: a search field, three category checkboxes under a Categories legend, and Apply Filters. The list behind stays where it was, and people go back to it once they've applied.
Preview
Installation
FAQ
How is the search field set up?
It's an input with type="search" and the label Search, in a Field. Browsers add a clear button to search inputs, and phones show a search key.
How are the categories grouped?
In a FieldSet whose FieldLegend reads Categories. Each category is a horizontal Field with the checkbox first and its label after, so clicking the label toggles the box.
Does Apply Filters filter anything?
Not yet: the checkboxes are uncontrolled and the button has no handler. Read the values when it's pressed, apply them to your list, and close the sheet.
How do I close the sheet after applying?
Control the open state and set it to false in the Apply handler:
Pass open to Sheet; onOpenChange receives the next boolean.
Related
- Contact Form SheetA right-side contact sheet with name
- Create New Item SheetA right-side sheet for adding an item
- Simple Single Select ComboboxA single-select combobox that opens from
- Multi-Step Form SheetA right-side setup sheet on step 1 of 3
- User Profile Edit SheetA right-side sheet for editing a username
- Article Preview SheetA right-side sheet previewing an article