FilterPanel
Structured filter panel with collapsible sections and reset/apply actions.
Design intent
Dashboards and directories need a consistent filter surface that works in a sidebar and a mobile drawer. FilterPanel owns section expansion and footer actions while the caller keeps filter values.
npx @slipstream-ui/cli@latest add filter-panelProject filters
Narrow the project set.
Props
| Prop | Type | Default | Description |
|---|---|---|---|
| sections | FilterSection[] | required | Filter groups: title, optional description, content and defaultOpen. |
| title | string | 'Filters' | Panel heading. |
| description | string | — | Supporting copy under the panel heading. |
| onReset | () => void | — | Reset action shown in the footer. |
| onApply | () => void | — | Apply action shown in the footer. |
| resetLabel | string | 'Reset' | Reset button label. |
| applyLabel | string | 'Apply' | Apply button label. |
| collapsible | boolean | true | Allow sections to collapse. |
| defaultOpen | string[] | — | Section titles open on first render. |
| actions | ReactNode | — | Extra footer content. |
| as | 'div' | 'aside' | 'section' | 'div' | Semantic element. |
Anti-patterns
validate_usage is the MCP tool that rejects these mistakes: the same list agents see over MCP and in the canonical markdown.
Don't own filter values in the panel
FilterPanel is layout and disclosure only. Keep values in the page or a filter hook so applied filters can be shared with the URL and chips.
tsx// Avoid duplicating state inside the panel
Accessibility
- Each section header is a button with aria-expanded and aria-controls.
- Panel title is h2 and section titles are h3.
Composition
Compose with Drawer: Render the panel inside a Drawer on mobile
<Drawer title="Filters"><FilterPanel ... /></Drawer>
Related components: MultiSelect, RangeSlider, DateRangePicker, AppliedFilters, FilterBar
Dependencies
What the registry installs alongside this component. Package imports already include these.
npm packages
- class-variance-authority
- clsx
- tailwind-merge
Browser support
| Browser | Tested versions |
|---|---|
| Chrome | 111+ (Mar 2023) |
| Edge | 111+ (Mar 2023) |
| Firefox | 121+ (Dec 2023) |
| Safari | 17.2+: macOS & iOS (Dec 2023) |
Slipstream components rely only on CSS custom properties, Flexbox/Grid, and ARIA, the everyday baseline of the last two years of evergreen releases. Anything newer is progressive enhancement: unsupported browsers keep full functionality with static behavior instead of animations.