API reference
FilterField
Filter Field is the presentation-only filter **chip**: a joined pill showing a
leading icon, the filter's label, the active selection summary (value) and
a clear or remove affordance, dashed while inactive. It is the shared chip used
across the filter family and the building block for custom filters.
It owns no popout and tracks no value — drop it into a popout-owning control as
its slot="trigger" (the host opens/positions the popout and sets
aria-controls/aria-haspopup/aria-expanded on this element). Show the
active selection with value, reset it in response to clear, and remove the
whole field in response to remove. Your app owns the active filters and any
URL/query state.
<nord-filter-field></nord-filter-field>Props
| Property | Attribute | Description | Type | Default |
|---|---|---|---|---|
label | label | The label naming what this filter targets, shown on the chip. | string | '' |
value | value | A short summary of the active selection (e.g. the selected option's label, or "3 selected"). When set the chip is shown as active and the clear button appears; leave it empty for an inactive filter. The chip does not derive this — set it from your app's state. | string | '' |
active | active | Forces the active (solid) treatment without a value summary, for filters
that are on but have nothing short to show. | boolean | false |
clearable | clearable | Shows a clear (✕) button while the chip is active. Defaults to true. Has no
effect when removable is set. | boolean | true |
icon | icon | The leading icon shown on the chip. | string | 'interface-filter' |
name | name | Identifies the filter (e.g. for your app's active-filter state). | string | '' |
removable | removable | Whether the whole field can be removed. When true the trailing affordance
is a remove button that fires remove; otherwise it is a clear button (shown
only when there is a value) that fires clear. | boolean | false |
disabled | disabled | Makes the component disabled. This prevents users from being able to interact with it and conveys its inactive state to assistive technologies. | boolean | false |
size | size | The size of the chip controls. | 's' | 'm' | 'l' | 's' |
| Event | Detail Type | Description |
|---|---|---|
clear | FilterFieldClearEvent | Dispatched when the clear affordance is pressed. |
remove | FilterFieldRemoveEvent | Dispatched when the remove affordance is pressed. |
Dependencies
This component is internally dependent on the following components:
- <nord-button>
Button
Buttons are used for interface actions. Primary style should be used only once per section for main call-to-action, while other styles can appear more frequently.
- <nord-button-group>
ButtonGroup
Button groups are designed to bring together button controls that are of a similar nature. For example text formatting controls.
- <nord-icon>
Icon
Icons are used to provide additional meaning or in places where text label doesn’t fit. Icon component allows you to display an icon from the Nordicons library.
- <nord-visually-hidden>
VisuallyHidden
Visually hidden is used when an element needs to be available to assistive technologies like screen readers, but be otherwise hidden.