Create

Form

Filters

New
Copy page View as Markdown Open in ChatGPT Open in Claude

A bar of filter chips: pick a field, an operator and a value.

Usage#

app.component.ts
import { WdsFiltersComponent } from '@wds/angular/filters';

The bar only builds the filters; it does not filter anything. Pass them to matchesFilters(), send them to the server, or put the bar in the toolbar slot of a Data Table, which filters its rows by itself.

Examples#

Default#

fields lists what can be filtered; type (text, number, select, date, boolean) decides the operators and the value editor. “Filter” opens a menu of the fields not used yet, and the new filter focuses its value. wds-change gives filters; matchesFilters(row, filters) checks a row against all of them (AND).

6 of 6 tasks

  • Write release notes2 pt · 2026-10-06
  • Fix login redirect3 pt · 2026-10-04
  • Review pricing page1 pt · 2026-09-30
  • Migrate billing API8 pt · 2026-10-20
  • Update onboarding emails5 pt · 2026-10-12
  • Audit color contrast3 pt · 2026-09-28

Initial filters and operators#

filters sets the starting filters (such as from the URL); each is { field, operator, value }, and a range (between) has [from, to]. A field's operators limits and orders the operator menu; the first one is used for a new filter. add-label and clear-label change the button texts.

[
  {
    "field": "total",
    "operator": "between",
    "value": [
      100,
      500
    ]
  },
  {
    "field": "placed",
    "operator": "after",
    "value": "2026-09-01"
  }
]

API References#

wds-filters#

A bar of filters: “Filter” opens a menu of fields, and each filter is a chip with the field, an operator menu, a value editor and a remove button. Filters are joined with AND. In a wds-data-table (slot toolbar) the table filters its rows by itself; elsewhere use matchesFilters() or send filters to the server.

Attributes

AttributeTypeDefaultDescription
labelstring'Filters'Accessible name of the bar.
add-label.addLabelstring'Filter'Text of the button that adds a filter.
clear-label.clearLabelstring'Clear'Text of the button that removes all filters.
disabledbooleanfalseDisables adding and changing filters.

Properties

PropertyDescription
fieldsWdsFilterField[]Fields that can be filtered (WdsFilterField[]).
filtersWdsFilter[]Active filters (WdsFilter[]), one per field.

Events

EventDescription
wds-changeCustomEvent<WdsFiltersChangeDetail>A filter was added, changed or removed.

CSS parts (::part)

PartDescription
chipA filter (field, operator, value, remove button).
addThe “Filter” button.
clearThe button that removes all filters.

Accessibility#

Screen reader#

The bar is a group named by label (default Filters); every filter is a group named after its field, such as “Status filter”.

The operator and the select and boolean values are menu buttons; the button name says the current value (symbols such as ≥ are read as “greater than or equal to”). The text, number and date fields are named after the field, and range fields “from” and “to”.

The remove button is named “Remove Status filter”. After a filter is removed, focus goes to the “Filter” button.

Keyboard support#

KeyFunction
TabMoves through the filters (operator, value, remove) and the “Filter” and “Clear” buttons.
EnterSpaceOpens the menu of the focused button, or chooses a menu item. A select value menu stays open, so several options can be checked.
EscapeCloses a menu and returns focus to its button.
Footer