Git Product home page Git Product logo

react-native-wheel-picker-simple's Introduction

React Native Wheel Picker Simple

A simple Wheel Picker, rendered with native components on Android and iOS. For iOS, pickerIOS is used. Forked from react-native-wheel-picker-android.

This picker works inside scrollViews.

screencast

Installation

  1. Install using yarn or npm
npm install react-native-wheel-picker-simple --save
yarn add react-native-wheel-picker-simple
  1. Link and don't forget to reinstall your app
react-native link react-native-wheel-picker-simple

Usage

<View style={wheelPickerWrapperStyle}>
  <WheelPicker
    itemStyle={{
      marginTop: -30,
      backgroundColor: '#111111',
      color: '#EEEEEE',
      fontSize: 12,
      fontFamily: "YourFontName"
    }}
    selectedItemTextFontFamily={'YourFontName'}
    itemTextFontFamily={'YourFontName'}
    selectedItemTextSize={12}
    itemTextSize={12}
    selectedItemTextColor={'#EEEEEE'}
    indicatorColor={'#999999'}
    selectedItem={this.state.selectedIndex}
    data={items}
    onItemSelected={this.onItemSelected} />
</View>
onItemSelected = selectedIndex => { this.setState({selectedIndex}); };

iOS Specific style

itemStyle prop is applied only to iOS.

Android Specific style

You can add styles conditionally based on OS

let wheelPickerWrapperStyle = [gs.centerChildren, gs.row, gs.centerAlongFlex];
if(Platform.OS === 'android')
  wheelPickerWrapperStyle.push(s.wheelPickerWrapperAndroid;

For more info, please refer to the parent repo

Limitations

  • iOS Date Picker is not customizable i.e. background color, fonts, etc. cannot be changed. No dark theme ๐Ÿ˜ž

  • iOS Picker line color cannot be changed ๐Ÿ˜Ÿ. At least it looks and feels okay in iOS, unlike the date picker.

Contribution

Issues are welcome. Please add a screenshot, if not screencast, of bug and code snippet. Quickest way to solve issue is to reproduce it on one of the examples.

Pull requests are very welcome.

  1. Fork the repo
  2. Create new branch with feature name as branch name
  3. Check if things work with a jupyter notebook
  4. Raise a pull request

Licence

Please see attached Licence

react-native-wheel-picker-simple's People

Contributors

artemkosiakevych avatar shhzdmrz avatar shobulive avatar saravanabalagi avatar lgoudin avatar nimatrueway avatar rigellute avatar andrewtsar0w avatar maxtoyberman avatar mahcloud avatar snnikitin avatar agenthunt avatar poberwong avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.