Search input

A field that filters something else on the page. It has the searchbox role, so a screen reader says what it is, and a clear button that is named rather than an icon.

Reach for it

Narrowing a set that is already on screen.

Not for

Choosing a value. Searching to select is a Combobox.

Debounced typing, immediate clearing

Typing is debounced so a list is not refetched on every keystroke. Clearing is not: a list that keeps its stale filter for another 300ms reads as a broken button. The magnifier is inert markup rather than a control, so it is not a tab stop.

Paste a column of references and they join with a comma

Committed query: none

  • INV-1042
  • INV-1043
  • INV-1051
  • INV-1088

API reference

SearchInput

PropTypeDefaultDescription
size'small' | 'medium' | 'large'medium
hasStartAdornmentbooleanfalseRoom for a marker or a button inside the control's own padding box. The padding belongs to the control, so it lives here. The marker's own geometry belongs to the marker, so it lives in adornment.ts. Four components each carried the whole table before, and the one in combobox.tsx said "mirroring SearchInput" in a comment, which is the note a copy leaves behind.
hasEndAdornment'true' | 'false' | 'double'false`double` is two markers at the end, a clear button beside a calendar button. Twice the room, so the value never runs under either of them.
valuestring-
defaultValuestring-
onValueChange(value: string) => void-Fired after the user stops typing. Fired immediately when cleared.
debounceMsnumber-
pasteSeparatorstring-Joins a pasted multi-line list into one query, using this separator. A single-line `<input>` flattens pasted newlines into spaces, which turns a column of copied references into one unsearchable string. Omit the prop and the browser default stands: the component does not assume what a caller's filter splits on.
clearLabelstring-Names the clear button, and its presence is what adds one. A boolean plus a label would be two props describing one decision, and the button cannot exist without a name anyway.

Also takes the standard attributes of a input, minus className, style, size, type, value, defaultValue and onChange.