FilterSidebar
Multi-facet filter panel for search results — Booking.com pattern. Four section types cover the common cases: chip-group (property type), range slider (price), star-rating selector, checkbox groups (amenities, meal plan). Sections collapse independently; each section shows an applied-count badge when active. Presentational — parent owns the values object and re-fetches on onChange.
{
"type": null,
"price": [
0,
1000
],
"rating": null,
"amenities": [],
"meal": []
}Section types
- —
chip-group— mutually exclusive pill buttons. Best for 3-6 short-label options like property type. Toggles off on active-click. - —
range— dual numeric slider with customformatValuecallback. Best for price, distance, size. - —
star-rating— visual star buttons viarole="radiogroup". Default choices[3, 4, 5]; customizable. - —
checkbox— multiple values with optional per-option count. SupportsvisibleLimitfor long lists with a "Show all N" toggle.
Usage notes
- — Presentational only. Parent owns the
valuesobject and re-fetches results inonChange. - —
Clear allonly appears when a filter is applied andonClearAllis provided. - — Section headers show an applied-count badge (with
--brand-primarytint) when the section has selections. - — Collapse state is local to the component. Use
defaultCollapsedto hint initial state. - — Mobile drawer variant deferred to a separate ticket — for now, wrap the sidebar in your own drawer / modal when the viewport is small.