Skip to components
DEVELOPER REFERENCE

FilterBar API

Props, callbacks and methods. Select an underlined type to explore its fields, allowed values and callback arguments.

FilterBar9 props3 callbacks0 methods

Preset and CSS

Set preset.className to attach your CSS class to the component's rendered surface. Explicit component props take precedence over preset options.

CSS parts in the example [data-part="root"]

Use styles.root and styles.parts in a theme and generate a CSS file with themeToCss. For other JSON-friendly component props, spread presetProps(preset) before explicit props. Parts and states depend on configuration; the gallery shows those visible in the current preview.

Props9

FilterBar props
NameTypeDescription
labelRequiredstringAccessible name for the filter toolbar.
filtersRequired
readonly ActiveFilter[]Inspect type
Active filters in display order.
removeLabelRequired
(filter: ActiveFilter) => stringInspect type
Localized removal label for each filter.
searchOptionalstring | undefinedOptional controlled search text.
searchLabelOptionalstring | undefinedLocalized search name; defaults to 'Search filters'.
clearLabelOptionalstring | undefinedLocalized clear action label; defaults to 'Clear filters'.
childrenOptional
ComponentChildrenInspect type
Optional host-owned filter creation controls.
presetOptional
ClassPreset | undefinedInspect type
Optional presentation preset.
classNameOptionalstring | undefinedAdditional root class names.

Events and callbacks3

FilterBar events and callbacks
NameTypeDescription
onRemoveOptional
((id: string) => void) | undefinedInspect type
Called when a filter is removed.
onSearchChangeOptional
((value: string) => void) | undefinedInspect type
Called when search text changes.
onClearOptional
(() => void) | undefinedInspect type
Called when all filters should be cleared.

Methods0

No component-specific imperative methods. Use props and callbacks to control this component.