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.
partially-compliant
- 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
murray and murray/mobile.Filters props
| Name | Type | Default Value | Description | Usage count |
|---|---|---|---|---|
| appliedFilters | AppliedFilterInterface[]undefined | [] | Applied filters which are rendered as filter pills. The remove callback is called with the respective key. | |
| filters | FilterInterface[] | [] | Available filters added to the filter bar. Shortcut filters are pinned to the front of the bar. | |
| onClearAll | (() => void)undefined | Called 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. |