Components · Form Controls
Filter Builder
BetaAdded v5.5.0
Build AND/OR filter queries with nested groups. The output is plain JSON your app runs.
import { FilterBuilder } from '@nexub/react';Examples
Deals filter
Props
| Prop | Type | Default | Description |
|---|---|---|---|
| fieldsrequired | FilterField[] | — | What can be filtered. The type picks the operators and the value input. |
| value | FilterGroup | — | { id, combinator: "and" | "or", rules: (FilterRule | FilterGroup)[] }; a rule is { id, field, operator, value: string }. |
| defaultValue | FilterGroup | — | { id, combinator: "and" | "or", rules: (FilterRule | FilterGroup)[] }; a rule is { id, field, operator, value: string }. |
| onValueChange | ((value: FilterGroup) => void) | — | Called with the whole query on every change. |
| maxDepth | number | 1 | Levels of nested groups "Add group" may create; 0 hides it. |
| className | string | — |
Accessibility
ARIA roles
Each group is a `group` named "Filters, match all/any".
Screen reader
Field, condition and value controls are labelled; remove buttons say what they remove.
Notes
Helpers: `emptyFilter()`, `countFilters(group)`, `isFilterGroup(rule)`, `filterOperators`.
On iOS & Android: FilterSheet
@nexub/react-nativeAlpha
import { FilterSheet } from '@nexub/react-native';
<FilterSheet open={open} onOpenChange={setOpen} fields={fields} value={query} onValueChange={setQuery} />Web vs mobile
Same tokens and prop names. Where the platforms differ:
| Web | iOS & Android | |
|---|---|---|
| Groups | Nested AND/OR groups. | One flat AND/OR list; nested groups from the web are kept, not edited. |
| Query | FilterGroup JSON. | The same FilterGroup JSON (from @nexub/core), so views move between platforms. |
Interactive preview of @nexub/react-native rendered for the web. Native chrome (switches, pickers, Liquid Glass) looks like the platform on a device.
On device

iPhone (iOS simulator)

Pixel (Android emulator)
Screenshots from the latest CI run of the showcase app; the live frame renders the same code for the web.
FilterSheet props
| Prop | Type | Default | Description |
|---|---|---|---|
| openrequired | boolean | — | — |
| onOpenChangerequired | (open: boolean) => void | — | — |
| fieldsrequired | FilterField[] | — | — |
| valuerequired | FilterGroup | — | The same JSON as the web FilterBuilder. Mobile edits one flat AND/OR list; nested groups are kept as they are. |
| onValueChangerequired | (value: FilterGroup) => void | — | — |
| title | string | — | — |