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 {}
filter-search-demo.tsxCopy code
Installation
Copy code
npm packages
lucide-reactUsage
ImportCopy code
Put it in a ServerDataTable toolbar, or in a FilterScope beside any view on a page controller.
API reference
FilterSearch
| Prop | Type | Default |
|---|---|---|
labelDefaults to the schema's first text field's label. | string | – |
placeholder | string | – |
schema | S | – |
controller | PageController<FilterValues<S>> | – |
className | string | – |
FilterScope
| Prop | Type | Default |
|---|---|---|
schemarequired | S | – |
controllerrequired | PageController<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 | – |
className | string | – |
children | ReactNode | – |
Other exports
useFilterScopeserverFilterstype FilterSearchPropstype FilterScopePropstype ServerFiltersFieldtype ServerFiltersOptionsAccessibility
- 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.