Skip to the content

InputSelect

InputSelect is a searchable select built on react-select: single, multi or async. It needs a client runtime; for a native, hydration-free control use Select. onChange always receives an array of { value, label } options, even in single mode.
Forms

When to use

Use when
  • The list is long and users should type to filter it.
  • Several values are picked as tags (isMulti).
  • Options load from an API (loadOptions).
Avoid when
  • The page has no client runtime, or a short native list is enough — use Select.
  • There are up to about five options — use Radio or Checkbox.

Usage

Pick a movie
<InputSelect
  aria-label="Movie"
  placeholder="Pick a movie"
  emptyMessage="No movies found"
  loadingPlaceholder="Loading…"
  options={options}
  onChange={([movie]) => setMovie(movie?.value)}
/>

Set placeholder, emptyMessage and loadingPlaceholder: their defaults are Portuguese. Other react-select props pass through; disabling is isDisabled, not disabled. readOnly keeps the menu closed and hides the clear control.

Multi and async

Pick movies
<InputSelect
  aria-label="Movies"
  isMulti
  loadOptions={(query) => fetch(`/api/movies?q=${query}`).then((r) => r.json())}
  onChange={setMovies}
/>

loadOptions returns a promise of options; the control is disabled and shows loadingPlaceholder while it resolves. In isMulti mode, onItemSelect fires once per added or removed item with a cancelAction to revert it.

Motion

The menu grows out of the control with the scale motion preset, zeroed under prefers-reduced-motion. motion="none" opens it instantly. It animates in only: react-select unmounts it on close.

Accessibility

  • react-select provides the combobox semantics, keyboard navigation and live announcements.
  • Field labels the container, not the search input: pass aria-label (in inputProps inside a Form).

Properties

Sizes read theme.component.inputSelect.size (expansive, medium, compact, micro).

See also