$ npm install react-native-simple-picker-sh --save
E.g.:
import {Picker} from 'react-native-simple-picker'
export default class TestPicker extends Component{
state={
pickedItem:''
}
render(){
return(
<View>
<Picker
items={['foo','bar']}
selectedValue={this.state.pickedItem}
placeHolder="Select an item"
onChange={(item)=>this.setState({pickedItem:item})}
height={40}
width={170}
itemsHeight={40}
itemsWidth={150}
/>
</View>
)
}
}
##Props
Callback when item is selected onChange={(text)=>onChangeText(text)}
Array of items to be shown items=['foo','bar']
What should be shown after the item selection
Background color for the picker view
default value : '#F5F5F5'
Border color for the picker view
default value : '#E0E0E0'
Border width for the picker view
Border radius for the picker view
Height of the picker view
default value : 50
Width of the picker view
default value : 170
Justify content flex property for the selected or placeholder value and the dropdown icon
default value : 'space-between'
Align items flex property for the selected or placeholder value and the dropdown icon
default value : 'center'
Padding for the items inside the picker view
default value : 10
Opacity for the onPress event of the picker view(range[0-1])
default value : 0.2
Placeholder to be shown in dropdown in case of no picked selected value or default selected value
default value : 'Select...'
Color of the placeholder or the selected item
default value : '#212121'
Font size of the placeholder or the selected item
default value : 20
Color of the dropdown icon
default value : '#000'
Transparency outside the picker popup(range[0-1])
default value : 0.8
absolute X position of the picker popup
absolute Y position of the picker popup
Height of a single item inside picker popup
default value : 40
Width of a single item inside picker popup
default value : 150
BackgroundColor of the items inside the picker popup
default value : '#E0E0E0'
default value : '#E0E0E0'
default value : 1
default value : '#000'
default value : 19