Skip to main content
Brand and assets
Build
Monitor and contribute
/
Component library
  • All components
  • Buttons & actions
  • Forms & inputs
    • Checkbox
    • ChoiceGroup
    • CurrencyInput
    • DateInput
    • FileInputZone
    • Filters
    • Form
    • MaskedTextInput
    • PasswordInput
    • Pill
    • Pill
    • Radio
    • SearchInput
    • SegmentedSlider
    • Select
    • Switch
    • TextArea
    • TextInput
  • Layout & containers
  • Overlays
  • Feedback & status
  • Data display
  • Typography
  • Accessibility
  • Contrib
  • Deprecated
  • Forms & inputs
  • Filters

Filters

A bar of filters over a list or a table. Pin the ones that should always show, and leave `onRemove` off a filter that must stay applied.

Health
Component health
Source
View on Github
Design
View Figma
Storybook
View in Storybook
Playground
No Example
Accessibility

partially-compliant

Platform
Universal
Accessibility issues
The filter navigation is not easy to understand. When closing the dropdown, the focus is not back to the original position. The button to remove a filter without opening the dropdown is not focusable.
  • Overview
  • Props
  • Figma

Usage​

Pin filters​

It's possible to pin some or all filters so they always appear by default

Required filters​

If an applied filter has no onRmeove prop, it will not be clearable. This is useful for filters that should always have a value.

Toggle filters​

A filter with toggleProps instead of filter renders as a pill that flips on and off, with no dropdown. Pin it so it stays visible, and add it to appliedFilters while it is on so the pill shows as selected. selectedIcon and unselectedIcon take the string name of any icon in the icon library.

Result counts​

Filter options can show how many results they match through the count prop of Checkbox and Radio, instead of concatenating the number into the label. 0 stays visible as (0).

Playground​

Loading...
tip
This component is universal, its usage is the same in murray and murray/mobile.

Filters props

NameTypeDefault ValueDescriptionUsage count
appliedFiltersAppliedFilterInterface[]undefined[]Applied filters which are rendered as filter pills. The remove callback is called with the respective key.
filtersFilterInterface[][]Available filters added to the filter bar. Shortcut filters are pinned to the front of the bar.
onClearAll(() => void)undefinedCalled by the "Clear all" button in place of the default behavior (removing each applied filter one by one). Lets a host clear everything in a single state update.
Edit this page
Previous
FileInputZone
Next
Form
  • Usage
  • Pin filters
  • Required filters
  • Toggle filters
  • Result counts
  • Playground