Skip to content

UI: SearchField

View as Markdown

A search input whose label is only announced. Import the token file once (@pithyx/ui/tokens.css) and wrap the app in UiProvider; see @pithyx/ui.

Generated from the TSDoc comments of @pithyx/ui 1.0.0-rc.9 at build time; the text below the headings is the comment in the source.

The props of SearchField; label is announced, not shown.

  • Omit<AriaSearchFieldProps, "className" | "children">
label: string;

The accessible name, announced but not shown.

optional placeholder?: string;

The visible hint inside the empty input.

optional className?: string;

Extra class names, added after the field’s own.

function SearchField(props): Element;

A search input whose label is only announced; the placeholder carries the visible hint. Escape and the clear button empty it.

Parameter Type Description
props SearchFieldProps React Aria’s search field props (value, onChange, onSubmit) plus label and placeholder.

Element

The search field.