Components
FilterBar
Add-filter control plus active filter chips, wired to the shared FiltersProvider state.
FilterBar is the turnkey filtering UI: an "Add filter" control that lets users
pick a field and build a condition, the row of active FilterChips, and an
advanced group editor that appears when nested groups are in play. It reads
everything from the surrounding FiltersProvider, so it takes no data props of
its own — only optional labels and an optional savedViews slot. Render it
inside FiltersProvider.
Example
Preview
import { FiltersProvider, FilterBar, SavedViews, useFilters } from '@officina/ui';
function Toolbar() {
const filters = useFilters({
mode: 'client',
fields: [{ id: 'status', label: 'Status', type: 'enum' }],
});
return (
<FiltersProvider value={filters}>
<FilterBar addLabel="Add filter" savedViews={<SavedViews urlKey="status" />} />
</FiltersProvider>
);
}API
| Prop | Type | Default | Description |
|---|---|---|---|
| addLabel | string | Add filter | Label for the add-filter control. |
| clearLabel | string | — | Label for the clear-filters control. |
| savedViews | ReactNode | — | Saved-views control rendered in the bar. |