Skip to content

Archive Filter Bar

The archive filter bar allows users to narrow article and research listings by taxonomy — tinnitus type, treatment modality, stage, evidence level, and audience. It presents a search input alongside filter controls, adapting its layout between desktop and mobile.

On desktop, filters appear as inline dropdown selects in a horizontal row with a “Filter” submit button. On mobile, each filter category becomes a compact chip in a horizontally scrollable row. Tapping a chip opens a checkbox dropdown; selections apply immediately and the chip fills to show the active count. This avoids stacking full-width dropdowns on small screens while keeping all filter categories accessible.

The component uses Tom Select for multi-select enhancement on the WordPress site, with custom CSS restyling for the chip pattern on mobile. This component uses naluma design system tokens (Plus Jakarta Sans, warm earth palette).


Desktop — inline filter bar

All Types
Treatment
Stage

Mobile — default state (375px)

Type
Treatment
Stage
Evidence
Audience

Mobile — dropdown open (375px)

Type
Treatment
Stage

Mobile — active filters (375px)

Type (2)
Treatment (1)
Stage
Evidence
Reset all

The component follows BEM naming under the block .tinnitus-filter-bar:

ClassElementPurpose
.tinnitus-filter-barBlockFilter bar container
__formChildDesktop form wrapper (flex row)
__searchChildSearch input container with icon
__inputChildText search input
__search-iconChildMagnifying glass SVG
__filtersChildDesktop dropdown group
__select-wrapChildIndividual desktop dropdown
__chipsChildMobile horizontal scroll chip row
__chipChildIndividual filter chip (mobile)
__chip-clearChild× button inside active chip
__dropdownChildCheckbox option panel
__optionChildIndividual checkbox row
__checkboxChildCheckbox indicator
__resetChild”Reset all” link

Chip modifiers: --open (dropdown visible), --active (has selections). Checkbox modifier: --checked.


PropertyValue
Flex1 1 250px (grows on desktop)
Padding10px 12px
Border1px solid (--semantic-color-border-subtle)
Border radius6px
Background--semantic-color-surface-card
Font size14px
PropertyValue
Padding10px 12px
Border1px solid (--semantic-color-border-subtle)
Border radius6px
Background--semantic-color-surface-card
Min width140px
Font size14px

PropertyValue
Padding8px 14px
Border1px solid (--semantic-color-border-subtle)
Border radius6px
Background--semantic-color-surface-card
Font size13px
Font weight500
Color
--semantic-color-text-primary
PropertyValue
Background
--semantic-color-action-primary
Color--primitive-color-white
Font weight600
Clear button16px circle, rgba(255,255,255,0.3) background
PropertyValue
Background--semantic-color-surface-card
Border1px solid (--semantic-color-border-subtle)
Border radius6px
Box shadow--primitive-shadow-lg
PropertyUncheckedChecked
Size18 × 18px18 × 18px
Border2px solid (--semantic-color-border-subtle)2px solid (--semantic-color-action-primary)
Backgroundtransparent--semantic-color-action-primary
Border radius4px4px
IconWhite checkmark

BreakpointLayout
≥767pxDesktop: inline flex row with search, dropdown selects, and Filter button
≤766pxMobile: search input + horizontal scrollable chip row + dropdown panels

  1. Default: Outline chips in horizontal scroll row — each represents a filter category
  2. Tap chip: Dropdown opens below with checkboxes. Results filter immediately on each checkbox change (no explicit Apply button)
  3. Active state: Chip fills with primary colour, shows count badge (e.g. “Type (2)”) and × clear button
  4. × on chip: Clears that filter category entirely, chip returns to outline state
  5. Tap active chip (not ×): Reopens dropdown with current selections checked
  6. “Reset all”: Appears at end of chip row when any filter is active, clears all filters

The WordPress implementation uses Tom Select v2.4.3 with:

  • checkbox_options plugin for multi-select checkboxes
  • remove_button plugin for per-item removal
  • Custom CSS to restyle .ts-wrapper as compact chips on mobile
  • Lightweight custom JS for count badge and category-clear ×

Without JavaScript, the component falls back to native <select multiple> elements — progressive enhancement.


  • Search is optional. The search input can be omitted on pages where text search is not needed. The chip row works independently.
  • Consistent 6px border-radius. All controls (search, chips, dropdowns, buttons) use the same 6px radius — do not mix with pill shapes.
  • Immediate filtering on mobile. Do not add an explicit “Apply” button inside the dropdown — each checkbox change filters results immediately, reducing friction.
  • Active chip must show count. When a filter has selections, always display the count (e.g., “Type (2)”). This gives users confidence about what is filtered.
  • “Reset all” placement. The reset link appears at the trailing edge of the chip row, scrolling into view when needed. Do not place it above or below the chips.