README.md 889 Bytes
Newer Older
xwenliang's avatar
init  
xwenliang committed
1 2 3 4
# react-native-picker

A Picker written in pure javascript for cross-platform support.

xwenliang's avatar
bugs  
xwenliang committed
5
It was most likely an example of how to build a cross-platform Picker Component use [react-native-picker-android](https://github.com/beefe/react-native-picker-android).
xwenliang's avatar
init  
xwenliang committed
6 7 8

Needs react-native >= 0.14.2

xwenliang's avatar
xwenliang committed
9 10
![ui](./doc/ui.gif)

xwenliang's avatar
init  
xwenliang committed
11 12
###Documentation

xwenliang's avatar
bugs  
xwenliang committed
13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41
####Props
- <b>pickerHeight</b> number
- <b>showDuration</b> number
- <b>pickerData</b> array
- <b>selectedValue</b> any
- <b>onPickerDone</b> function

###Usage

####Step 1 - install

```
	npm install react-native-picker --save
```

####Step 2 - import and use in project

```javascript
	import Picker from 'react-native-picker'
	
	<Picker
		ref={picker => {this.picker = picker;}}
		pickerHeight={300}
		showDuration={300}
		pickerData={}//picker`s value List
		selectedValue={}//default to be selected value
		onPickerDone={}//when confirm your choice
	/>
```