1.1.2 • Published 4 years ago

react-native-option-picker v1.1.2

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

react-native-option-picker

A simple and customizable React Native option picker tool.

npm version npm downloads

Getting Started

View example on snack.expo.io

Install

$ npm install react-native-option-picker

Basic Usage

import {Picker} from 'react-native-option-picker';

export const CustomPicker = () => {

    function _onPress(elem){
        alert(JSON.stringify(elem));
    }

    return (
        <Picker
            data={[
                { id: '9', title: '9:00 AM', selected: false },
                { id: '10', title: '10:00 AM', selected: true },
                { id: '11', title: '11:00 AM', selected: false },
            ]}
            onPress={this._onPress}
        />
    );
};

Styling

PropDescriptionType
stylePicker stylingAny
optionStyleStyle for the idle optionAny
selectedOptionStyleStyle for the selected optionAny
optionTextStyleStyle for the option textAny
selectedOptionTextStyleStyle for the selected option textAny

Methods

Methods may be accessed through the instantiated component's ref.

PropDescription
onPress(element)Returns the selected element when an option is selected.

Contributing

Contributions are welcome!

  1. Fork it.
  2. Create your feature branch: git checkout -b my-new-feature
  3. Commit your changes: git commit -am 'Add some feature'
  4. Push to the branch: git push origin my-new-feature
  5. Submit a pull request :D

Or open up an issue.

Contributors

Gustavo Reyes💬 💻

Discussion and Collaboration

In addition to the Github Issues page

License

Licensed under the MIT License.