react-native-picker / Picker

Licence: mit
Picker is a cross-platform UI component for selecting an item from a list of options.

Programming Languages

javascript
184084 projects - #8 most used programming language

Projects that are alternatives of or similar to Picker

Notebooks
code for deep learning courses
Stars: ✭ 522 (-1.69%)
Mutual labels:  hacktoberfest
Rvm
Development repository for the rvm cookbook
Stars: ✭ 525 (-1.13%)
Mutual labels:  hacktoberfest
Date Time Picker
Angular Date Time Picker (Responsive Design)
Stars: ✭ 528 (-0.56%)
Mutual labels:  picker
Binaryen
Compiler infrastructure and toolchain library for WebAssembly
Stars: ✭ 5,294 (+896.99%)
Mutual labels:  hacktoberfest
Upup
✈️ Easily create sites that work offline as well as online
Stars: ✭ 4,777 (+799.62%)
Mutual labels:  hacktoberfest
Es6 Articles
Blog Posts from Wes Bos. If you make an edit to one of these posts, my blog will automatically update.
Stars: ✭ 527 (-0.75%)
Mutual labels:  hacktoberfest
Skll
SciKit-Learn Laboratory (SKLL) makes it easy to run machine learning experiments.
Stars: ✭ 523 (-1.51%)
Mutual labels:  hacktoberfest
Trafficcontrol
Apache Traffic Control is an Open Source implementation of a Content Delivery Network
Stars: ✭ 530 (-0.19%)
Mutual labels:  hacktoberfest
Tenanti
[Package] Multi-tenant Database Schema Manager for Laravel
Stars: ✭ 525 (-1.13%)
Mutual labels:  hacktoberfest
Nginx
Development repository for the nginx cookbook
Stars: ✭ 528 (-0.56%)
Mutual labels:  hacktoberfest
Bpmn Js
A BPMN 2.0 rendering toolkit and web modeler.
Stars: ✭ 5,592 (+953.11%)
Mutual labels:  hacktoberfest
Hound
Lightning fast code searching made easy
Stars: ✭ 4,955 (+833.15%)
Mutual labels:  hacktoberfest
Lgphotobrowser
照片浏览器,相册选择器,自定义照相机(支持单拍、连拍)
Stars: ✭ 527 (-0.75%)
Mutual labels:  picker
Reakit
Toolkit for building accessible rich web apps with React
Stars: ✭ 5,265 (+891.53%)
Mutual labels:  hacktoberfest
Czpicker
a picker view shown as a popup for iOS in Objective-C
Stars: ✭ 529 (-0.38%)
Mutual labels:  picker
Autoblue Ms17 010
This is just an semi-automated fully working, no-bs, non-metasploit version of the public exploit code for MS17-010
Stars: ✭ 522 (-1.69%)
Mutual labels:  hacktoberfest
Gazpacho
🥫 The simple, fast, and modern web scraping library
Stars: ✭ 525 (-1.13%)
Mutual labels:  hacktoberfest
Serverless Dynamodb Local
Serverless Dynamodb Local Plugin - Allows to run dynamodb locally for serverless
Stars: ✭ 530 (-0.19%)
Mutual labels:  hacktoberfest
Golem
A Framework for Building Robust Shiny Apps
Stars: ✭ 530 (-0.19%)
Mutual labels:  hacktoberfest
Egua
🦄 Linguagem de programação em português, simples e moderna
Stars: ✭ 528 (-0.56%)
Mutual labels:  hacktoberfest

@react-native-picker/picker

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

Android iOS PickerIOS Windows MacOS

Supported Versions

@react-native-picker/picker react-native
>= 1.2.0 0.60+ or 0.59+ with Jetifier
>= 1.0.0 0.57

For Managed Workflow users using Expo 37

This component is not supported in the managed workflow for expo sdk 37. Please import the Picker from react-native. See more info here

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 [email protected] and above supports autolinking there is no need to run the linking process. Read more about autolinking here.

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 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.

pch.h

Add #include "winrt/ReactNativePicker.h".

app.cpp

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)<

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>

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
Type Required
function No

selectedValue

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

Type Required
any No

style

Type Required
pickerStyleType No

testID

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

Type Required
string No

enabled

If 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

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
Type Required Platform
enum('dialog', 'dropdown') No Android

dropdownIconColor

On Android, specifies color of dropdown triangle. Input value should be hexadecimal string.

Type Required Platform
string No Android

prompt

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

Type Required Platform
string No Android

itemStyle

Style to apply to each of the item labels.

Type Required Platform
text styles No iOS, Windows

PickerIOS

Props


Reference

Props

itemStyle

Type Required
text styles No

onValueChange

Type Required
function No

selectedValue

Type Required
any No
Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].