API reference
The f builders
Every f.* builder and its type-specific options.
f is the set of filter builders. Each returns a config object; the builder fixes
the value type and the type-specific options. Every builder also accepts the
shared options
(label, placeholder, defaultValue, hidden, commit, meta, nuqs).
See Filter types for examples of each.
| Builder | params.<key> | Type-specific options |
|---|---|---|
f.text | string | null | — |
f.number | number | null | precision: 'float' | 'int' |
f.numberRange | [number, number] | null | precision: 'float' | 'int' |
f.boolean | boolean | null | trueLabel, falseLabel |
f.date | string | null | precision: 'date' | 'datetime' |
f.dateRange | [string, string] | null | precision: 'date' | 'datetime' |
f.time | string | null | precision: 'minute' | 'second' |
f.timeRange | [string, string] | null | precision: 'minute' | 'second' |
f.select | V | null | options, valueType |
f.multiSelect | V[] | null | options, valueType |
f.tags | string[] | null | — |
f.asyncSelect | V | null | loadOptions, valueType, searchDebounceMs |
f.asyncMultiSelect | V[] | null | loadOptions, valueType, searchDebounceMs |
Notes on specific options
options:{ label, value, count?, meta? }[]. Forselect/multiSelect, the value typeVis checked againstvalueType.valueType:'number' | 'string', required. Declares the URL value type, type-checked against the option values (orVfor the async variants). See Async › value types.loadOptions:(search, signal) => Promise<FilterOption[]>. The async server search;signalaborts stale requests.searchDebounceMs: debounce forloadOptions(default300). Distinct from a filter'scommit: { debounce }, which defers the URL write.precisionnarrows parsing:'int'truncates numbers;'datetime'/'second'add time components to dates / times.
f.number / f.numberRange's unit option was removed in 1.0. Declare a unit field on
NumberFilterMeta / NumberRangeFilterMeta and pass it via meta instead. See UI
metadata.
f is re-exported from every createFilters instance
and from the package root.