"use client";
import { SearchField } from "@pixxl-tools/components";| Prop | Type | Default | Description |
|---|---|---|---|
invalid | boolean | — | Marks the control invalid (aria-invalid); FormField sets it from error. |
size | ComponentSize | — | Size from the shared scale (xs, sm, md, lg). |
clearLabel | string | "Clear" from the catalog | Accessible name of the clear button (default "Clear" from the catalog). |
formatResultsCount | (count: number) => string | "{count} results" / "No results" from the catalog | Text for the announced count (default "{count} results" / "No results" from the catalog), e.g. (count) => \${count} sounds\``. |
leading | ReactNode | — | Content before the main content (icon, prefix). |
onClear | () => void | — | Shows a clear button while the field has a value; called when it is pressed. |
onValueChange | (value: string, event: ChangeEvent<HTMLInputElement>) => void | — | Called with the new value (only when it changes). |
resultsCount | number | null | — | Number of results the query currently matches. When set (also 0), a polite live region announces it once typing settles (500 ms) and again for every new query — screen reader users hear "7 results" / "No results" (WCAG 4.1.3). Pass it from the first render. |
trailing | ReactNode | — | Content after the main content (icon, suffix). |
invalidboolean
Marks the control invalid (aria-invalid); FormField sets it from error.
sizeComponentSize
Size from the shared scale (xs, sm, md, lg).
clearLabeldefault "Clear" from the catalogstring
Accessible name of the clear button (default "Clear" from the catalog).
formatResultsCountdefault "{count} results" / "No results" from the catalog(count: number) => string
Text for the announced count (default "{count} results" / "No results" from the catalog), e.g. (count) => \${count} sounds\``.
leadingReactNode
Content before the main content (icon, prefix).
onClear() => void
Shows a clear button while the field has a value; called when it is pressed.
onValueChange(value: string, event: ChangeEvent<HTMLInputElement>) => void
Called with the new value (only when it changes).
resultsCountnumber | null
Number of results the query currently matches. When set (also 0), a polite live region announces it once typing settles (500 ms) and again for every new query — screen reader users hear "7 results" / "No results" (WCAG 4.1.3). Pass it from the first render.
trailingReactNode
Content after the main content (icon, suffix).
Complex object props use fixed fixtures. Primitive props stay editable.
<SearchField aria-label="SearchField" size="md" invalid={false} disabled={false} placeholder="Search files" /><SearchField aria-label="Search" /><SearchField aria-label="SearchField" size="md" invalid={false} disabled={false} placeholder="Search files" />