
Security News
GitHub Actions Pricing Whiplash: Self-Hosted Actions Billing Change Postponed
GitHub postponed a new billing model for self-hosted Actions after developer pushback, but moved forward with hosted runner price cuts on January 1.
@aks-dev/react-native-picker_picker
Advanced tools
@react-native-picker/picker| Android | iOS | PickerIOS | Windows | MacOS |
|---|---|---|---|---|
![]() | ![]() | ![]() | ![]() | ![]() |
| @react-native-picker/picker | react-native |
|---|---|
| >= 1.16.0 | 0.61+ |
| >= 1.2.0 | 0.60+ or 0.59+ with Jetifier |
| >= 1.0.0 | 0.57 |
This component is not supported in the managed workflow for expo sdk 37. Please import the Picker from react-native.
See more info here
$ npm install @react-native-picker/picker --save
or
$ yarn add @react-native-picker/picker
As react-native@0.60 and above supports autolinking there is no need to run the linking process. Read more about autolinking here.
CocoaPods on iOS needs this extra step:
npx pod-install
No additional step is required.
Usage in Windows requires the following extra steps:
ReactNativePicker project to your solution.D:\dev\RNTest\node_modules\@react-native-picker\picker\windows\ReactNativePicker\ReactNativePicker.vcxprojAdd 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.
Add #include "winrt/ReactNativePicker.h".
Add PackageProviders().Append(winrt::ReactNativePicker::ReactPackageProvider()); before InitializeComponent();.
CocoaPods on MacOS needs this extra step (called from the MacOS directory)
pod install
The following steps are only necessary if you are working with a version of React Native lower than 0.60
$ react-native link @react-native-picker/picker
Libraries ➜ Add Files to [your project's name]node_modules ➜ @react-native-picker/picker and add RNCPicker.xcodeprojlibRNCPicker.a to your project's Build Phases ➜ Link Binary With LibrariesCmd+R)<android/app/src/main/java/[...]/MainApplication.java)import com.reactnativecommunity.picker.RNCPickerPackage; to the imports at the top of the filenew RNCPickerPackage() to the list returned by the getPackages() methodandroid/settings.gradle:
include ':@react-native-picker_picker'
project(':@react-native-picker_picker').projectDir = new File(rootProject.projectDir, '../node_modules/@react-native-picker/picker/android')
android/app/build.gradle:
implementation project(path: ':@react-native-picker_picker')
Libraries ➜ Add Files to [your project's name]node_modules ➜ @react-native-picker/picker and add RNCPicker.xcodeprojlibRNCPicker.a to your project's Build Phases ➜ Link Binary With LibrariesCmd+R)<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>
onValueChangeCallback for when an item is selected. This is called with the following parameters:
itemValue: the value prop of the item that was selecteditemPosition: the index of the selected item in this picker| Type | Required |
|---|---|
| function | No |
selectedValueValue matching value of one of the items. Can be a string or an integer.
| Type | Required |
|---|---|
| any | No |
style| Type | Required |
|---|---|
| pickerStyleType | No |
testIDUsed to locate this view in end-to-end tests.
| Type | Required |
|---|---|
| string | No |
enabledIf set to false, the picker will be disabled, i.e. the user will not be able to make a selection.
| Type | Required | Platform |
|---|---|---|
| bool | No | Android, Windows |
modeOn Android, specifies how to display the selection items when the user taps on the picker:
| Type | Required | Platform |
|---|---|---|
| enum('dialog', 'dropdown') | No | Android |
dropdownIconColorOn Android, specifies color of dropdown triangle. Input value should be hexadecimal string.
| Type | Required | Platform |
|---|---|---|
| string | No | Android |
promptPrompt string for this picker, used on Android in dialog mode as the title of the dialog.
| Type | Required | Platform |
|---|---|---|
| string | No | Android |
itemStyleStyle to apply to each of the item labels.
| Type | Required | Platform |
|---|---|---|
| text styles | No | iOS, Windows |
numberOfLinesOn Android, 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'
| Type | Required | Platform |
|---|---|---|
| number | No | Android |
onBlur| Type | Required | Platform |
|---|---|---|
| function | no | Android |
onFocus| Type | Required | Platform |
|---|---|---|
| function | no | Android |
blur (Android only, lib version 1.16.0+)Programmatically closes picker
focus (Android only, lib version 1.16.0+)Programmatically opens picker
Props that can be applied to individual Picker.Item
labelDisplayed value on the Picker Item
| Type | Required |
|---|---|
| string | yes |
valueActual value on the Picker Item
| Type | Required |
|---|---|
| number,string | yes |
colorDisplayed color on the Picker Item
| Type | Required |
|---|---|
| string | no |
fontFamilyDisplayed fontFamily on the Picker Item
| Type | Required |
|---|---|
| string | no |
styleStyle to apply to individual item labels.
| Type | Required | Platform |
|---|---|---|
| ViewStyleProp | no | Android |
enabledIf set to false, the specific item will be disabled, i.e. the user will not be able to make a selection
@default: true
| Type | Required | Platform |
|---|---|---|
| boolean | no | Android |
itemStyle| Type | Required |
|---|---|
| text styles | No |
onValueChange| Type | Required |
|---|---|
| function | No |
selectedValue| Type | Required |
|---|---|
| any | No |
FAQs
@react-native-picker/picker v1.16.3
We found that @aks-dev/react-native-picker_picker demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Security News
GitHub postponed a new billing model for self-hosted Actions after developer pushback, but moved forward with hosted runner price cuts on January 1.

Research
Destructive malware is rising across open source registries, using delays and kill switches to wipe code, break builds, and disrupt CI/CD.

Security News
Socket CTO Ahmad Nassri shares practical AI coding techniques, tools, and team workflows, plus what still feels noisy and why shipping remains human-led.