YYonda UI Docs

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 custom formatValue callback. Best for price, distance, size.
  • — star-rating — visual star buttons via role="radiogroup". Default choices [3, 4, 5]; customizable.
  • — checkbox — multiple values with optional per-option count. Supports visibleLimit for long lists with a "Show all N" toggle.

Usage notes

  • — Presentational only. Parent owns the values object and re-fetches results in onChange.
  • — Clear all only appears when a filter is applied and onClearAll is provided.
  • — Section headers show an applied-count badge (with --brand-primary tint) when the section has selections.
  • — Collapse state is local to the component. Use defaultCollapsed to 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.