Inputs
SearchControl
- Design notes
- Meeting minutes
- Quarterly reports
- Release checklists
- Reading list
When to use
- Search over a list, a library or an API with a single visual contract.
- You need a clear button that returns focus to the field.
- On a wide screen (from
md) you need the on-screenKeyboardthrough thekeyboardprop.
When not to use
- For plain text —
TextControl. - For choosing from a list of options —
Combobox; for filtering a closed list — a searchableSelect. - Set a shared debounce policy in the consumer, not here.
Minimal example
<SearchControl
label="Search collections"
value={query}
onChange={setQuery}
placeholder="Find a collection…"
/>Public API
value,onChange(string),labelare required. Aplaceholderdoes not replacelabel.clearableis true by default;clearLabel,shellClassNameand native input props are available.keyboardrequireslayoutandonLayoutChange;defaultOpenaffects only the initial opening;onSubmitis called by the on-screen keyboard.
Height step
size is passed through to TextControl: md is 42 pixels (the default), sm is
36, the same height as Button size="md" and of the Select pill in the same
toolbar row.
The step lives on TextControl, not here. Search is deliberately built on it, and a
height of its own for search would mean a second way to compute it inside the
package itself — exactly the divergence SearchControl was introduced to avoid.
Accessibility and keyboard
- Escape deliberately passes through to the parent overlay; add an
onKeyDownhandler if you need to clear the query. - The on-screen keyboard button is hidden below
md; a mouse click on the keyboard panel returns the caret to the field. - Source:
src/components/inputs/SearchControl.tsx; checks —tests/search-control.test.tsx.
TypeScript types
SearchControlProps
Prop
Type
Plus DOM attributes, such as disabled, placeholder, onClick — 304 in total; the table does not repeat them.