Skip to main content

FilterChips

packages/leisure/components/molecules/FilterChips.js · Tier: molecule · Module: leisure · Rendering: Server Component

Purpose​

A generic chip-based filter. It renders either as links (with hrefBuilder) or as buttons (with onSelect), highlighting the active value. Used across event and location filters.

Props​

PropTypeRequiredDefaultDescription
optionsArray<{ value: string | null, label, icon? }>yes—The chip options.
activeValuestring | nullyes—The currently selected value.
onSelect(value) => voidno—Button-mode click handler.
hrefBuilder(value) => stringno—Link-mode href builder (takes precedence, making chips links).
ariaLabelstringno—Group label.

Variants & states​

link (SSR filter navigation, scroll={false}) vs button (client callback); active chip uses the primary colour pair.

Composition​

  • Uses: atoms/core/Icon, next/link.
  • Used by: organisms/leisure/EventFilters, organisms/leisure/LocationFilters.

Internationalisation​

Option labels supplied (localized) by the caller.

Accessibility​

role="group" with aria-pressed on each chip.

Styling & tokens​

bg-primary/text-on-primary active, bg-surface-container-low idle, rounded-md.

organisms/leisure/EventFilters, organisms/leisure/LocationFilters, molecules/leisure/FilterSection.