Zum Inhalt springen

UI: SearchField

Als Markdown ansehen

Ein Suchfeld, dessen Beschriftung nur vorgelesen wird. Importiere die Token-Datei einmal (@pithyx/ui/tokens.css) und umschließe die App mit UiProvider; siehe @pithyx/ui.

Beim Build aus den TSDoc-Kommentaren von @pithyx/ui 1.0.0-rc.9 erzeugt; der Text unter den Überschriften ist der Kommentar im Quelltext und bleibt Englisch.

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 Typ Beschreibung
props SearchFieldProps React Aria’s search field props (value, onChange, onSubmit) plus label and placeholder.

Element

The search field.