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.

Builderparams.<key>Type-specific options
f.textstring | null
f.numbernumber | nullprecision: 'float' | 'int'
f.numberRange[number, number] | nullprecision: 'float' | 'int'
f.booleanboolean | nulltrueLabel, falseLabel
f.datestring | nullprecision: 'date' | 'datetime'
f.dateRange[string, string] | nullprecision: 'date' | 'datetime'
f.timestring | nullprecision: 'minute' | 'second'
f.timeRange[string, string] | nullprecision: 'minute' | 'second'
f.selectV | nulloptions, valueType
f.multiSelectV[] | nulloptions, valueType
f.tagsstring[] | null
f.asyncSelectV | nullloadOptions, valueType, searchDebounceMs
f.asyncMultiSelectV[] | nullloadOptions, valueType, searchDebounceMs

Notes on specific options

  • options: { label, value, count?, meta? }[]. For select / multiSelect, the value type V is checked against valueType.
  • valueType: 'number' | 'string', required. Declares the URL value type, type-checked against the option values (or V for the async variants). See Async › value types.
  • loadOptions: (search, signal) => Promise<FilterOption[]>. The async server search; signal aborts stale requests.
  • searchDebounceMs: debounce for loadOptions (default 300). Distinct from a filter's commit: { debounce }, which defers the URL write.
  • precision narrows 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.

On this page