@react-native-picker/picker vs react-native-picker-select vs react-native-dropdown-picker vs @react-native-community/picker
React Native Picker and Dropdown Libraries
@react-native-picker/pickerreact-native-picker-selectreact-native-dropdown-picker@react-native-community/pickerSimilar Packages:
React Native Picker and Dropdown Libraries

React Native Picker and Dropdown Libraries are UI components that allow users to select a value from a list. They are essential for forms and user input in mobile applications. These libraries provide customizable, accessible, and touch-friendly dropdown menus that work seamlessly across iOS and Android platforms. They often support features like multi-select, search, and styling to match the app's design.

Npm Package Weekly Downloads Trend
3 Years
Github Stars Ranking
Stat Detail
Package
Downloads
Stars
Size
Issues
Publish
License
@react-native-picker/picker630,2531,732399 kB250a month agoMIT
react-native-picker-select123,6641,84345.8 kB102a year agoMIT
react-native-dropdown-picker89,9351,038161 kB1653 years agoMIT
@react-native-community/picker8,6181,732-2505 years agoMIT
Feature Comparison: @react-native-picker/picker vs react-native-picker-select vs react-native-dropdown-picker vs @react-native-community/picker

Customization

  • @react-native-picker/picker:

    @react-native-picker/picker offers improved customization features, including the ability to style the picker and its items more extensively, making it more flexible for developers.

  • react-native-picker-select:

    react-native-picker-select is highly customizable, allowing developers to style the picker, use custom components for items, and implement placeholder and done buttons.

  • react-native-dropdown-picker:

    react-native-dropdown-picker allows for extensive customization, including multi-select, custom item rendering, and animated dropdowns, making it highly versatile for modern applications.

  • @react-native-community/picker:

    @react-native-community/picker provides basic customization options such as styling the picker and its items. However, it is limited compared to other libraries.

Multi-Select Support

  • @react-native-picker/picker:

    @react-native-picker/picker also does not support multi-select. It is focused on providing a single-value selection experience.

  • react-native-picker-select:

    react-native-picker-select is primarily a single-select picker but can be extended to support multi-select with custom implementations.

  • react-native-dropdown-picker:

    react-native-dropdown-picker supports multi-select out of the box, allowing users to select multiple items from the dropdown, which is a significant advantage for applications that require this feature.

  • @react-native-community/picker:

    @react-native-community/picker does not support multi-select functionality. It is designed for single-value selection only.

Accessibility

  • @react-native-picker/picker:

    @react-native-picker/picker improves accessibility features compared to its predecessor, ensuring better support for screen readers and keyboard navigation.

  • react-native-picker-select:

    react-native-picker-select is designed with accessibility in mind, providing support for screen readers and customizable accessibility labels.

  • react-native-dropdown-picker:

    react-native-dropdown-picker includes accessibility features but may require additional work to ensure it meets all standards, especially for custom components.

  • @react-native-community/picker:

    @react-native-community/picker follows native accessibility standards, making it usable for people with disabilities. However, it may lack some advanced accessibility features.

Code Example

  • @react-native-picker/picker:

    Basic usage of @react-native-picker/picker

    import React, { useState } from 'react';
    import { View, Text } from 'react-native';
    import { Picker } from '@react-native-picker/picker';
    
    const App = () => {
      const [selectedValue, setSelectedValue] = useState('java');
    
      return (
        <View>
          <Text>Select a language:</Text>
          <Picker
            selectedValue={selectedValue}
            onValueChange={(itemValue) => setSelectedValue(itemValue)}
          >
            <Picker.Item label="Java" value="java" />
            <Picker.Item label="JavaScript" value="js" />
            <Picker.Item label="Python" value="python" />
          </Picker>
        </View>
      );
    };
    
    export default App;
    
  • react-native-picker-select:

    Basic usage of react-native-picker-select

    import React, { useState } from 'react';
    import { View, Text } from 'react-native';
    import RNPickerSelect from 'react-native-picker-select';
    
    const App = () => {
      const [selectedValue, setSelectedValue] = useState(null);
    
      return (
        <View>
          <Text>Select a language:</Text>
          <RNPickerSelect
            onValueChange={(value) => setSelectedValue(value)}
            items={[
              { label: 'Java', value: 'java' },
              { label: 'JavaScript', value: 'js' },
              { label: 'Python', value: 'python' },
            ]}
          />
        </View>
      );
    };
    
    export default App;
    
  • react-native-dropdown-picker:

    Basic usage of react-native-dropdown-picker

    import React, { useState } from 'react';
    import { View } from 'react-native';
    import DropDownPicker from 'react-native-dropdown-picker';
    
    const App = () => {
      const [open, setOpen] = useState(false);
      const [value, setValue] = useState(null);
      const [items, setItems] = useState([
        { label: 'Java', value: 'java' },
        { label: 'JavaScript', value: 'js' },
        { label: 'Python', value: 'python' },
      ]);
    
      return (
        <View>
          <DropDownPicker
            open={open}
            value={value}
            items={items}
            setOpen={setOpen}
            setValue={setValue}
            setItems={setItems}
          />
        </View>
      );
    };
    
    export default App;
    
  • @react-native-community/picker:

    Basic usage of @react-native-community/picker

    import React, { useState } from 'react';
    import { View, Text } from 'react-native';
    import { Picker } from '@react-native-community/picker';
    
    const App = () => {
      const [selectedValue, setSelectedValue] = useState('java');
    
      return (
        <View>
          <Text>Select a language:</Text>
          <Picker
            selectedValue={selectedValue}
            onValueChange={(itemValue) => setSelectedValue(itemValue)}
          >
            <Picker.Item label="Java" value="java" />
            <Picker.Item label="JavaScript" value="js" />
            <Picker.Item label="Python" value="python" />
          </Picker>
        </View>
      );
    };
    
    export default App;
    
How to Choose: @react-native-picker/picker vs react-native-picker-select vs react-native-dropdown-picker vs @react-native-community/picker
  • @react-native-picker/picker:

    Select @react-native-picker/picker for a more modern and actively maintained version of the picker component. It offers better performance, accessibility, and customization options, making it suitable for both simple and complex applications.

  • react-native-picker-select:

    Choose react-native-picker-select for a highly customizable picker that supports single and multi-select, as well as placeholder and done buttons. It is great for apps that need more control over the picker’s appearance and behavior.

  • react-native-dropdown-picker:

    Opt for react-native-dropdown-picker if you need a feature-rich dropdown with multi-select capabilities, custom styling, and animations. It is perfect for applications that require more interactive and visually appealing dropdowns.

  • @react-native-community/picker:

    Choose @react-native-community/picker if you need a simple, lightweight picker component that follows native design patterns. It is ideal for projects that require basic functionality without additional dependencies.

README for @react-native-picker/picker

@react-native-picker/picker

npm version Build Supports Android, iOS, MacOS, and Windows MIT License Lean Core Extracted

AndroidiOSPickerIOS
WindowsMacOS

Supported Versions

@react-native-picker/pickerreact-nativereact-native-windows
>= 2.0.00.61+0.64+
>= 1.16.00.61+0.61+
>= 1.2.00.60+ or 0.59+ with JetifierN/A
>= 1.0.00.57N/A

Getting started

$ npm install @react-native-picker/picker --save

or

$ yarn add @react-native-picker/picker

For React Native v0.60 and above (Autolinking)

As react-native@0.60 and above supports autolinking there is no need to run the linking process. Read more about autolinking here. This is supported by react-native-windows@0.64 and above.

iOS

CocoaPods on iOS needs this extra step:

npx pod-install

Android

No additional step is required.

Windows (expand for details)

Windows

Usage in Windows without autolinking requires the following extra steps:

Add the ReactNativePicker project to your solution.
  1. Open the solution in Visual Studio 2019
  2. Right-click Solution icon in Solution Explorer > Add > Existing Project Select D:\dev\RNTest\node_modules\@react-native-picker\picker\windows\ReactNativePicker\ReactNativePicker.vcxproj
windows/myapp.sln

Add a reference to ReactNativePicker to your main application project. From Visual Studio 2019:

Right-click main application project > Add > Reference... Check ReactNativePicker from Solution Projects.

app.cpp

Add #include "winrt/ReactNativePicker.h" to the headers included at the top of the file.

Add PackageProviders().Append(winrt::ReactNativePicker::ReactPackageProvider()); before InitializeComponent();.

MacOS

CocoaPods on MacOS needs this extra step (called from the MacOS directory)

pod install
React Native below 0.60 (Link and Manual Installation)

The following steps are only necessary if you are working with a version of React Native lower than 0.60

Mostly automatic installation

$ react-native link @react-native-picker/picker

Manual installation

iOS

  1. In XCode, in the project navigator, right click LibrariesAdd Files to [your project's name]
  2. Go to node_modules @react-native-picker/picker and add RNCPicker.xcodeproj
  3. In XCode, in the project navigator, select your project. Add libRNCPicker.a to your project's Build PhasesLink Binary With Libraries
  4. Run your project (Cmd+R)<

Android

  1. Open application file (android/app/src/main/java/[...]/MainApplication.java)
  • Add import com.reactnativecommunity.picker.RNCPickerPackage; to the imports at the top of the file
  • Add new RNCPickerPackage() to the list returned by the getPackages() method
  1. Append the following lines to android/settings.gradle:
    include ':@react-native-picker_picker'
    project(':@react-native-picker_picker').projectDir = new File(rootProject.projectDir, 	'../node_modules/@react-native-picker/picker/android')
    
  2. Insert the following lines inside the dependencies block in android/app/build.gradle:
      implementation project(path: ':@react-native-picker_picker')
    

MacOS

  1. In XCode, in the project navigator, right click LibrariesAdd Files to [your project's name]
  2. Go to node_modules @react-native-picker/picker and add RNCPicker.xcodeproj
  3. In XCode, in the project navigator, select your project. Add libRNCPicker.a to your project's Build PhasesLink Binary With Libraries
  4. Run your project (Cmd+R)<

RTL Support

you need to add android:supportsRtl="true" to AndroidManifest.xml

   <application
      ...
      android:supportsRtl="true">

Usage

Import Picker from @react-native-picker/picker:

import {Picker} from '@react-native-picker/picker';

Create state which will be used by the Picker:

const [selectedLanguage, setSelectedLanguage] = useState();

Add Picker like this:

<Picker
  selectedValue={selectedLanguage}
  onValueChange={(itemValue, itemIndex) =>
    setSelectedLanguage(itemValue)
  }>
  <Picker.Item label="Java" value="java" />
  <Picker.Item label="JavaScript" value="js" />
</Picker>

If you want to open/close picker programmatically on android (available from version 1.16.0+), pass ref to Picker:

const pickerRef = useRef();

function open() {
  pickerRef.current.focus();
}

function close() {
  pickerRef.current.blur();
}

return <Picker
  ref={pickerRef}
  selectedValue={selectedLanguage}
  onValueChange={(itemValue, itemIndex) =>
    setSelectedLanguage(itemValue)
  }>
  <Picker.Item label="Java" value="java" />
  <Picker.Item label="JavaScript" value="js" />
</Picker>

Props


Reference

Props

onValueChange

Callback for when an item is selected. This is called with the following parameters:

  • itemValue: the value prop of the item that was selected
  • itemPosition: the index of the selected item in this picker
TypeRequired
functionNo

selectedValue

Value matching value of one of the items. Can be a string or an integer.

TypeRequired
anyNo

style

TypeRequired
pickerStyleTypeNo

testID

Used to locate this view in end-to-end tests.

TypeRequired
stringNo

enabled

If set to false, the picker will be disabled, i.e. the user will not be able to make a selection.

TypeRequiredPlatform
boolNoAndroid, Web, Windows

mode

On Android, specifies how to display the selection items when the user taps on the picker:

  • 'dialog': Show a modal dialog. This is the default.
  • 'dropdown': Shows a dropdown anchored to the picker view
TypeRequiredPlatform
enum('dialog', 'dropdown')NoAndroid

dropdownIconColor

On Android, specifies color of dropdown triangle. Input value should be value that is accepted by react-native processColor function.

TypeRequiredPlatform
ColorValueNoAndroid

dropdownIconRippleColor

On Android, specifies ripple color of dropdown triangle. Input value should be value that is accepted by react-native processColor function.

TypeRequiredPlatform
ColorValueNoAndroid

prompt

Prompt string for this picker, used on Android in dialog mode as the title of the dialog.

TypeRequiredPlatform
stringNoAndroid

itemStyle

Style to apply to each of the item labels.

TypeRequiredPlatform
text stylesNoiOS, Windows

numberOfLines

On Android & iOS, used to truncate the text with an ellipsis after computing the text layout, including line wrapping, such that the total number of lines does not exceed this number. Default is '1'

TypeRequiredPlatform
numberNoAndroid, iOS

onBlur

TypeRequiredPlatform
functionNoAndroid

onFocus

TypeRequiredPlatform
functionNoAndroid

selectionColor

TypeRequiredPlatform
ColorValueNoiOS

Methods

blur (Android only, lib version 1.16.0+)

Programmatically closes picker

focus (Android only, lib version 1.16.0+)

Programmatically opens picker

PickerItemProps

Props that can be applied to individual Picker.Item

label

Displayed value on the Picker Item

TypeRequired
stringYes

value

Actual value on the Picker Item

TypeRequired
number,stringYes

color

Displayed color on the Picker Item

TypeRequired
ColorValueNo

fontFamily

Displayed fontFamily on the Picker Item

TypeRequired
stringNo

style

Style to apply to individual item labels.

TypeRequiredPlatform
ViewStylePropNoAndroid

enabled

If set to false, the specific item will be disabled, i.e. the user will not be able to make a selection

@default: true

TypeRequiredPlatform
booleanNoAndroid

contentDescription

Sets the content description to the Picker Item

TypeRequiredPlatform
stringNoAndroid

PickerIOS

Props


Reference

Props

itemStyle

TypeRequired
text stylesNo

onValueChange

TypeRequired
functionNo

selectedValue

TypeRequired
anyNo

selectionColor

TypeRequiredPlatform
ColorValueNoiOS

themeVariant

TypeRequired
enum('light', 'dark')No