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.
- Host: GitHub
- URL: https://github.com/alluximx/react-native-option-picker
- Owner: alluximx
- Created: 2020-05-27T16:48:21.000Z (about 6 years ago)
- Default Branch: master
- Last Pushed: 2020-06-05T16:29:28.000Z (about 6 years ago)
- Last Synced: 2024-04-26T16:21:36.135Z (about 2 years ago)
- Topics: control, form, picker, radio, react, react-native, select
- Language: JavaScript
- Homepage:
- Size: 367 KB
- Stars: 5
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# react-native-option-picker
A simple and customizable React Native option picker tool.
[](https://badge.fury.io/js/react-native-option-picker)
[](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.