Compare browser selection controls and native mobile pickers by platform, selection state, data contracts and required customization.
react-dropdown, react-dropdown-select and react-select render React DOM controls. react-native-picker-select and react-native-select-dropdown target React Native screens. A cross-platform product can compare them by the interaction it wants, but sharing a label/value option model does not make browser components native replacements.
react-dropdown supplies a single-select button/listbox interface. It supports primitive/object options, grouping and render customization. value/defaultValue and open/defaultOpen represent controlled or initial uncontrolled state; controlling selection does not automatically control menu visibility. null clears selection, while zero and false remain valid values. A name creates a hidden form input, and styling requires its stylesheet or a complete custom setup. Its React and React DOM peers target 18 or 19. An old description calling it only a legacy unmaintained widget does not describe the current published API.
react-dropdown-select uses options and an array of selected values, with onChange reporting an array even for a single selection. multi enables multiple selections; labelField/valueField map application records to display and identity. Custom rendering and browser portal targets need deliberate lifecycle and focus handling. The peer ranges accept React and React DOM >=16.8. Its API is not react-select with renamed imports, and multiple is not the documented multi prop.
react-select has single/multiple modes, component/style overrides and separate async/creatable entry routes. Selection value, inputValue and menuIsOpen are separate controllable state dimensions. Remote loading still needs an application policy for requests and stale responses; creating an option in the UI does not persist it. Its React/React DOM peer ranges cover 16.8, 17, 18 and 19.
react-native-picker-select wraps @react-native-picker/picker, declared as a native peer in the ^2.4 range. Configure that peer for the actual native/Expo environment. Its iOS trigger/picker flow and Android default native styling differ; useNativeAndroidPickerStyle changes the Android trigger route rather than making it a browser dropdown. Item labels, values and keys are distinct; selection reports value/index. Follow its iOS itemKey guidance when users must change the selection.
react-native-select-dropdown is a custom single-selection dropdown, not a built-in multi-select. Supply data, onSelect and the current renderButton/renderItem callbacks. Search can use internal filtering, but supplying onChangeSearchInputText transfers filtering responsibility to the application. It also exposes open/close/reset/select-index methods. Rendering a button or calling an imperative method does not make selection fully controlled through a value prop.
Pick the platform first, then single/multiple selection, search, visual ownership and state/data conventions. Keep a native browser select or platform picker when it satisfies the need; use a custom widget for an explicit product requirement. Map stable option identities, clearing, reset, remote data and submission deliberately. Check labels, keyboard/focus behavior and surrounding scrolling in the target environment instead of declaring one package an unconditional winner.
Choose a configurable browser selection widget with single/multi modes and async/creatable extension routes, managing value, search and menu state separately.
Choose a platform-aware React Native picker wrapper, integrating its native picker peer and handling iOS/Android trigger differences.
Choose a styled React DOM single-select with controlled/uncontrolled value and open state, when search or multiple selection is unnecessary.
Choose a customizable single-selection React Native dropdown with explicit button/row renderers and optional search.
Choose a browser select with search, multi selection and renderer overrides, mapping selected options through its array-valued contract.
The Select control for React. Initially built for use in KeystoneJS.
See react-select.com for live demos and comprehensive docs.
React Select is funded by Thinkmill and Atlassian. It represents a whole new approach to developing powerful React.js components that just work out of the box, while being extremely customisable.
For the story behind this component, watch Jed's talk at React Conf 2019 - building React Select
Features include:
The easiest way to use react-select is to install it from npm and build it into your app with Webpack.
yarn add react-select
Then use it in your app:
import React from 'react';
import Select from 'react-select';
const options = [
{ value: 'chocolate', label: 'Chocolate' },
{ value: 'strawberry', label: 'Strawberry' },
{ value: 'vanilla', label: 'Vanilla' },
];
class App extends React.Component {
state = {
selectedOption: null,
};
handleChange = (selectedOption) => {
this.setState({ selectedOption }, () =>
console.log(`Option selected:`, this.state.selectedOption)
);
};
render() {
const { selectedOption } = this.state;
return (
<Select
value={selectedOption}
onChange={this.handleChange}
options={options}
/>
);
}
}
import React, { useState } from 'react';
import Select from 'react-select';
const options = [
{ value: 'chocolate', label: 'Chocolate' },
{ value: 'strawberry', label: 'Strawberry' },
{ value: 'vanilla', label: 'Vanilla' },
];
export default function App() {
const [selectedOption, setSelectedOption] = useState(null);
return (
<div className="App">
<Select
defaultValue={selectedOption}
onChange={setSelectedOption}
options={options}
/>
</div>
);
}
Common props you may want to specify include:
autoFocus - focus the control when it mountsclassName - apply a className to the controlclassNamePrefix - apply classNames to inner elements with the given prefixisDisabled - disable the controlisMulti - allow the user to select multiple valuesisSearchable - allow the user to search for matching optionsname - generate an HTML input with this name, containing the current valueonChange - subscribe to change eventsoptions - specify the options the user can select fromplaceholder - change the text displayed when no option is selectednoOptionsMessage - ({ inputValue: string }) => string | null - Text to display when there are no optionsvalue - control the current valueSee the props documentation for complete documentation on the props react-select supports.
You can control the following props by providing values for them. If you don't, react-select will manage them for you.
value / onChange - specify the current value of the controlmenuIsOpen / onMenuOpen / onMenuClose - control whether the menu is openinputValue / onInputChange - control the value of the search input (changing this will update the available options)If you don't provide these props, you can set the initial value of the state they control:
defaultValue - set the initial value of the controldefaultMenuIsOpen - set the initial open value of the menudefaultInputValue - set the initial value of the search inputReact-select exposes two public methods:
focus() - focus the control programmaticallyblur() - blur the control programmaticallyCheck the docs for more information on:
The v5 release represents a rewrite from JavaScript to TypeScript. The types for v4 and earlier releases are available at @types. See the TypeScript guide for how to use the types starting with v5.
Thank you to everyone who has contributed to this project. It's been a wild ride.
If you like React Select, you should follow me on twitter!
Shout out to Joss Mackison, Charles Lee, Ben Conolly, Tom Walker, Nathan Bierema, Eric Bonow, Emma Hamilton, Dave Brotherstone, Brian Vaughn, and the Atlassian Design System team who along with many other contributors have made this possible ❤️
MIT Licensed. Copyright (c) Jed Watson 2022.