Filter

A group of toggleable pill or outline buttons for filtering content by category

Category: inputs · WCAG 2.2-AA · filter, chip, tag, pill, facet, category

Variants

States

Props

PropTypeDefaultDescription
ariaLabelstringInvisible accessible name. The catalog convention; the DOM spelling `aria-label` is accepted as an alias so either guess compiles.
aria-labelstringAccessible label for the filter group.
optionsFilterOption[]Array of { label, value } objects to render as filter buttons
valuestring[]Controlled selected values
defaultValuestring[][]Initial selected values for uncontrolled use
onValueChange(selected: string[]) => voidCalled with the selected values whenever the selection changes.
onChange(selected: string[]) => voidDeprecated: use onValueChange (same string[]).
multibooleanfalseAllow multiple items to be selected simultaneously
variant'pill' | 'outline'pillSelects the visual style variant.

Design tokens

When to use

When not to use

How to build an accessible Filter in React →

Examples

Single-select

<Filter
  options={[
    { label: 'All', value: 'all' },
    { label: 'Active', value: 'active' },
    { label: 'Archived', value: 'archived' },
  ]}
  aria-label="Filter by status"
/>

Multi-select

<Filter
  multi
  options={[
    { label: 'Design', value: 'design' },
    { label: 'Engineering', value: 'engineering' },
    { label: 'Marketing', value: 'marketing' },
  ]}
  aria-label="Filter by team"
/>

Outline variant

<Filter
  variant="outline"
  options={[{ label: 'React', value: 'react' }, { label: 'Vue', value: 'vue' }]}
  aria-label="Filter by framework"
/>

Related components

← Back to docs