0.1.0 • Published 6 years ago

react-native-controlled-picker v0.1.0

Weekly downloads
1
License
MIT
Repository
github
Last release
6 years ago

react-native-controlled-picker

A 100% controlled and declarative Picker for React Native

Installation

yarn add react-native-controlled-picker

or

npm install react-native-controlled-picker --save

Examples

Simplest example

Run this example on Expo

Read the source code

Styled example

Run this example on Expo

Read the source code

Props

PropertyTypeDefaultDescription
openbooleanfalseWhether the items modal is open or not
itemsarray of objects[]Array of objects with label and value keys
valueanynullThe value of the current selected item
placeholderany'Please select...'Text to be displayed when there's no selected item
onPressfunctionFunction to be called when the user clicks on the picker
onChangefunctionFunction to be called when the user selects an item
onClosefunctionFunction to be called when the user request to close the modal
stylefunction{}Additional style for the picker's container view
textStylefunction{}Additional style for the picker's text
placeholderStylefunction{}Additional style for the picker's placeholder
modalStylefunction{}Additional style for the modal's container view
listStylefunction{}Additional style for the list's container view
itemStylefunction{}Additional style for the item's text

Contributing

Please create issues and send pull requests!

License

MIT