FilterCondition
FilterCondition shows one filter as separate field, operator, value and remove parts. Use it when the user edits a filter from its summary. For a chip that only removes, use FilterChip.
- Wrap each FilterConditionSegment in a PopoverTrigger or DropdownMenuTrigger with
asChild. - Your app owns open state, draft values, when changes apply and focus after removal.
- All parts share one compact height that follows density. There is no
sizeprop. - Editor inputs set their own size.
- Segments are native buttons, so Enter and Space activate them.
- The full summary stays accessible when it truncates on screen.
- See Patterns/Filtering for recipes that apply changes at once or on Apply.
Installation
Run npx nxds-cli@latest init first if nxds isn’t set up in your app yet. See Install.
Usage
Composition
Props
FilterCondition
FilterCondition adds no props of its own; it accepts the props of the element or primitive it wraps.
FilterConditionField
FilterConditionField adds no props of its own; it accepts the props of the element or primitive it wraps.
FilterConditionRemove
| Prop | Type | Default | Description |
|---|---|---|---|
aria-labelRequired | string | No default documented | Defines a string value that labels the current element. |
FilterConditionSegment
FilterConditionSegment adds no props of its own; it accepts the props of the element or primitive it wraps.
FilterCondition shows one filter as separate field, operator, value and remove parts. Use it when the user edits a filter from its summary. For a chip that only removes, use FilterChip.
- Wrap each FilterConditionSegment in a PopoverTrigger or DropdownMenuTrigger with
as-child. - Your app owns open state, draft values, when changes apply and focus after removal.
- All parts share one compact height that follows density. There is no
sizeprop. - Editor inputs set their own size.
- Segments are native buttons, so Enter and Space activate them.
- The full summary stays accessible when it truncates on screen.
- See Patterns/Filtering for recipes that apply changes at once or on Apply.
Installation
Install these components first:
Copy and paste the following code into your project.
components/filter-condition/FilterCondition.vue components/filter-condition/FilterConditionField.vue components/filter-condition/FilterConditionRemove.vue components/filter-condition/FilterConditionSegment.vue components/filter-condition/index.ts Keep each file at the path shown above it.
Paths are relative to
packages/vue/src/. Keep the same folders under your@/root, and the imports between files work without edits.
Usage
Props
FilterCondition
FilterCondition adds no props of its own; it accepts the props of the element or primitive it wraps.
FilterConditionField
FilterConditionField adds no props of its own; it accepts the props of the element or primitive it wraps.
FilterConditionRemove
| Prop | Type | Default | Description |
|---|---|---|---|
ariaLabelRequired | string | No default documented | Defines a string value that labels the current element. |
FilterConditionSegment
FilterConditionSegment adds no props of its own; it accepts the props of the element or primitive it wraps.