Installation
Add the dependency:
npm i react-native-horizontal-picker-2
Peer Dependencies
```Zero Dependency`
Usage
Import
import HorizontalPicker from "react-native-horizontal-picker-2";
Fundamental Usage
<HorizontalPicker
style={{ flex: 0, height: 75 }}
data={[1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15]}
onChange={(val, index) => {
console.log({ val, index });
setValueSelection(val);
}}
/>
😍
Example Project You can checkout the example project
Simply run
npm i
react-native run-ios/android
should work of the example project.
Configuration - Props
Fundamentals
Property | Type | Default | Description |
---|---|---|---|
data | any[] | undefined | set the data |
onChange | function | undefined | set your own logic when the selected data is changed |
Customization (Optionals)
Property | Type | Default | Description |
---|---|---|---|
style | ViewStyle | default | set or override the style object for the main container |
Future Plans
- [x]
LICENSE - [ ] Full Code Refactor
- [ ] Better example
- [ ] Cooler GIF
- [ ] Write an article about the lib on Medium
Credits
This is a new fork from React Native Picker Horizontal Since this is no updated more than 2 years, I will maintain this one :)
Author
FreakyCoder, kurayogun@gmail.com
License
React Native Horizontal Picker 2 is available under the MIT license. See the LICENSE file for more info.