ReactSelect
The ReactSelect component adapts react-select to Payload's styles and interaction patterns. It is also exported as Select.
Import
Inside a Payload Admin Panel Custom Component:
You can also import the component directly:
Basic usage
Store the selected option object rather than only its value. Use isMulti when users can select more than one option.
By default, the options menu is rendered in a portal so it can escape drawers and other containers without being clipped.
Multiple values
Enable isMulti to store an array of selected options. Add isSortable when users should also be able to reorder those values by dragging them.
Accessibility
- Add
aria-labelor associate the select with a visible field label when its purpose is not clear from nearby text. - Keep option labels unique and concise.
- Preserve keyboard search and selection behavior when supplying custom
components.
Common props
These are the props most commonly used with this component. See its exported types in @payloadcms/ui for the complete list.
Prop | Type | Default | Description |
|---|---|---|---|
| | — | Options displayed in the menu. |
| | — | Selected option or options. |
| | — | Runs when the selection changes or is cleared. |
| | Localized | Sets the empty-state label. |
| | | Allows multiple selected values. |
| | | Allows selected multi-value items to be reordered. |
| | | Displays a control for clearing the value. |
| | | Allows options to be filtered by typing. |
| | | Allows users to create values not in |
| | | Prevents interaction. |
| | | Displays the loading state. |
| | | Applies the validation error style. |
* An asterisk denotes that a prop is required.
Was this page helpful?