React Select's Select component is already searchable: when you pass an options array, users can type in the control to filter the list. Install react-select, import Select, and pass options shaped as { value, label }. For options loaded from a server, use AsyncSelect instead.
The old react-select/dist/react-select.css import from version 1 tutorials is obsolete. Current react-select (v5) bundles its styles, so there is nothing to import.
Version 5 works with React 17, 18 and 19, and includes TypeScript types.
Each option needs a label (text the user sees and searches) and a value. Filtering is on by default through isSearchable, so you rarely need to set it.
The component is controlled here: value holds the chosen option object and onChange receives the new option (or null after clearing).
Typing filters the options with a default matcher that checks the label and value, ignoring case and accents. You can replace it with the filterOption prop:
To search by more than the label, build the matcher from option.data, which holds the original object, including any extra fields you added.
| Prop | Purpose |
|---|---|
isSearchable | Allows typing to filter (default true). |
isClearable | Shows a clear button. |
isMulti | Allows selecting several options. |
noOptionsMessage | Text when no option matches. |
defaultValue | Initial option for an uncontrolled select. |
name | Renders a hidden input so the value is submitted with a form. |
Rendering thousands of options on the client is slow. If options come from an API, use AsyncSelect from react-select/async, which calls a loadOptions function with the typed text. For very long static lists, filter on the server or use a virtualised menu component.
Besides filtering, you can control how options look and behave. Use formatOptionLabel to render richer content such as an icon next to the text, and isOptionDisabled to block certain entries.
The label is still what the search matches, so keep it meaningful. Grouped options are supported too: pass objects shaped as { label: "Group", options: [...] } and the menu renders headings automatically.
Connect the control to a visible label with inputId and a matching <label htmlFor="...">, or provide aria-label. The library announces the focused option and the number of results to screen readers. If your list is short (under about seven items) and does not need search, a native <select> is usually the more accessible and lighter choice.
Use value and onChange when other parts of the page depend on the selection. For a simple form field, defaultValue with the name prop is enough: the component keeps its own state and submits the chosen value with the form.
It is searchable by default. Pass isSearchable explicitly if you want to be clear, or set it to false to turn typing off.
That file belongs to version 1. Remove the import; later versions inject styles through Emotion.
Read selected?.value from the state, or map it in onChange: onChange={(opt) => setValue(opt?.value ?? null)}.
A native <select> is simpler and fully accessible by default. Select adds search, multi-select, custom rendering and async loading.
Use Select from react-select with { value, label } options to get a searchable dropdown with no extra setup. Customise matching with filterOption, switch to AsyncSelect for remote data, and drop the obsolete CSS import from older guides.