Skip to content

alluximx/react-native-option-picker

Repository files navigation

react-native-option-picker

A simple and customizable React Native option picker tool.

npm version npm downloads



Getting Started

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

Prop Description Type
style Picker styling Any
optionStyle Style for the idle option Any
selectedOptionStyle Style for the selected option Any
optionTextStyle Style for the option text Any
selectedOptionTextStyle Style for the selected option text Any

Methods

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

Prop Description
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.

Releases

No releases published

Packages

No packages published