An open API service indexing awesome lists of open source software.

https://github.com/alluximx/react-native-option-picker

Easy to use option picker component for React Native.
https://github.com/alluximx/react-native-option-picker

control form picker radio react react-native select

Last synced: about 1 year ago
JSON representation

Easy to use option picker component for React Native.

Awesome Lists containing this project

README

          

# react-native-option-picker

A simple and customizable React Native option picker tool.

[![npm version](https://badge.fury.io/js/react-native-option-picker.svg)](https://badge.fury.io/js/react-native-option-picker)
[![npm downloads](https://img.shields.io/npm/dm/react-native-option-picker.svg?style=flat-square)](https://www.npmjs.com/package/react-native-option-picker)




## Getting Started

### [View example on snack.expo.io](https://snack.expo.io/@gus_reyes01/react-native-option-picker)

### Install

```sh
$ npm install react-native-option-picker
```

### Basic Usage

```js

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

export const CustomPicker = () => {

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

return (

);
};

```

## 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](https://reactjs.org/docs/react-component.html).

| 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](https://github.com/gusreyes01/react-native-option-picker/issues).

## Contributors

[
Gustavo Reyes](https://github.com/gusreyes01)
[💬](#question-alluximx "Answering Questions") [💻](https://github.com/alluximx/react-native-option-picker/commits?author=gusreyes01 "Code")

## Discussion and Collaboration

In addition to the [Github Issues](https://github.com/alluximx/react-native-option-picker/issues) page

## License

Licensed under the MIT License.