Skip to content
Eskais UI

Server data

Filter Search

The search box of a filter schema: shows the text at once and commits it after the page controller's 250 ms debounce, Enter commits, Escape clears. FilterScope gives filter UIs their schema and controller and lets agents filter by a field's label.

Example

Typed "", sent after 250 ms {}

Installation

npx shadcn@latest add @eskais/filter-search
npm packageslucide-react

Usage

Import
import { FilterSearch } from "@/components/ui/filter-search"import { FilterScope, useFilterScope } from "@/components/ui/filter-scope"import { serverFilters } from "@/components/ui/server-filters-primitive"

Put it in a ServerDataTable toolbar, or in a FilterScope beside any view on a page controller.

API reference

FilterSearch

PropTypeDefault
labelDefaults to the schema's first text field's label.string–
placeholderstring–
schemaS–
controllerPageController<FilterValues<S>>–
classNamestring–

FilterScope

PropTypeDefault
schemarequiredS–
controllerrequiredPageController<FilterValues<S>>–
labelrequiredNames the filters for agents, who set them with `filter(field, value)`, `search` and `clearFilters`.string–
searchPlaceholderThe placeholder of a `FilterSearch` inside that doesn't set its own: "Search tasks…".string–
classNamestring–
childrenReactNode–

Other exports

useFilterScopeserverFilterstype FilterSearchPropstype FilterScopePropstype ServerFiltersFieldtype ServerFiltersOptions

Accessibility

  • A search landmark named by the field's label; Escape clears only when there is text.

Agent actions

Agents set the search by its label, and it commits at once; FilterScope adds filter(field, value).

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