Skip to content
Eskais UI

Server data

Filter Field

The control for one filter schema field, named by its label: an input for text, a select or checkboxes for options, a select for a boolean, a comparison and numbers, date pickers, or a ServerCombobox for remote options.

Example

Points
Created

Values {"priority":"high"}

Installation

npx shadcn@latest add @eskais/filter-field

Usage

Import
import { appliesAtOnce, FilterField, filterFieldLabels } from "@/components/ui/filter-field"import { filterFieldLabels } from "@/components/ui/filter-field-labels"

Use it to edit one schema field anywhere: the chips and the panel are built on it.

API reference

FilterField

PropTypeDefault
fieldrequiredFilterFieldDefinition–
valuerequiredunknown–
onValueChangerequired(value: unknown) => void–
labelsPartial<FilterFieldLabels>–
valueLabelsLabels of remote option values that haven't loaded, like ids from the URL.Readonly<Record<string, string>>–
onSubmitEnter in a text or number input, to apply at once.() => void–
onValueLabelsThe labels of remote options as they are chosen, for a summary that shows labels, not ids.(labels: Readonly<Record<string, string>>) => void–
localeWrites dates and numbers in the pickers and inputs; the page's `<html lang>` by default (`useLocale`).string–
classNamestring–

Other exports

appliesAtOncefilterFieldLabelstype FilterFieldLabelstype FilterFieldProps

Accessibility

  • Every control is named by the field's label; groups of checkboxes and number pairs are labelled groups.

Agent actions

Runs agent.snapshot() from @ui-sdk/react/agent on the live preview above.