Skip to main content
Neural UIv2.0.0Documentation
View v1 GitHub

FilterBar

Apply one or several filter chips with application-owned active state.

Category
Data and hierarchy
Import
@neural-ui/core/filter-bar
Selector
neu-filter-bar
import { NeuFilterBarComponent } from '@neural-ui/core/filter-bar';

Usage

filters contains the full catalogue with stable keys, labels and optional active flags. filterChange emits only active filters: update each catalogue item's active flag by key, preserving inactive options, then filter your own data. multi=false keeps at most one active chip; clearable resets all active flags. FilterBar does not query a backend or filter a Table automatically.

Examples

Try this application-owned interaction. Its event handling and initial data are included in Code.

Examples

Events: 0

Try and configure

Change the public options, try the result and inspect the updated template. Code contains the complete executable implementation.

Try and configure

Events: 0

template.html
<neu-filter-bar
  [filters]="localizedFilters()"
  [multi]="true"
  [clearable]="true"
  [clearLabel]="'Clear all'"
  (filterChange)="onFilterChange($event)"
  [ariaLabel]="'Order filters'"
/>

State and events

The application owns the full filter catalogue. filterChange contains active filters only; accept it by updating active flags by key without replacing or removing catalogue entries. An empty payload means no active filters, not an empty catalogue.

Accessibility and keyboard

Tab reaches each chip; Enter/Space toggles it. The pressed state reflects the applied active flag.

Key
Action
Tab Focus each enabled filter chip.
Enter Propose toggling the focused filter; the applied active value controls its pressed state.
Space Propose toggling the focused filter; the applied active value controls its pressed state.

API

Inputs, models and Outputs are extracted from the installed Core package. Named public types link to their definitions. Templates below include executable examples.

Inputs

Configure the component with [property]="value". Your application supplies these values; the component does not replace the state you pass in.

Name
Type
Default
Template binding
Description
ariaLabelstring'Filters'[ariaLabel]Accessible name of the control or region.
clearablebooleantrue[clearable]Shows a clear action when a value is selected.
clearLabelstring'Clear all'[clearLabel]Label for the clear-selection action.
filtersreadonly NeuFilterChip[][][filters]Chips with stable keys, labels and applied active flags.
multibooleantrue[multi]Allow several active filters; false keeps at most one.

Outputs

Listen to an event with (event)="handler($event)". The table explains the data your handler receives and how to use it.

Name
Payload
Template binding
Description
filterChangeNeuFilterChip[](filterChange)="onFilterChange($event)"Proposes the complete updated filter array, including active states. Replace filters to accept it.

Templates

ng-content projects content into the component. TemplateRef inputs receive a template; ng-template directives identify templates with a typed context. A directive shared by an entrypoint is not necessarily a slot of this component.

This component does not expose content projection or public customization templates.

Public Types

Open a type to inspect its definition and interface fields.

Styles and tokens

Use the supported public tokens listed below. Surrounding layout belongs to your application; validate the result in light and dark modes and narrow containers.

Specific tokens

This component uses shared theme tokens rather than dedicated component hooks.

Shared tokens used

Override these on a local wrapper to affect this example. An override on :root affects other components that use the same token.

Token
Purpose here
Other impact
Default / fallback
--neu-focus-ring Normal keyboard-focus ring Shared by other Core consumers; scope the override. 0 0 0 var(--neu-focus-ring-width) rgba(0, 122, 255, 0.15)
--neu-primary Brand color for active controls and emphasis Shared by other Core consumers; scope the override. #007aff
--neu-primary-dark Dark brand shade; outline and ghost Button text in the light theme Shared by other Core consumers; scope the override. #005fcc
--neu-border-color Inherited theme value used by this component Shared by other Core consumers; scope the override. var(--neu-border)
--neu-radius-full Corner radius Shared by other Core consumers; scope the override. 9999px
--neu-surface-1 Inherited theme value used by this component Shared by other Core consumers; scope the override. var(--neu-surface)
--neu-text-primary Inherited theme value used by this component Shared by other Core consumers; scope the override. var(--neu-text)
--neu-text-secondary Inherited theme value used by this component Shared by other Core consumers; scope the override. var(--neu-text-muted)