https://github.com/bamlab/react-native-numberpicker-dialog
Show a dialog on Android, allowing to choose an option using NumberPicker
https://github.com/bamlab/react-native-numberpicker-dialog
Last synced: about 1 year ago
JSON representation
Show a dialog on Android, allowing to choose an option using NumberPicker
- Host: GitHub
- URL: https://github.com/bamlab/react-native-numberpicker-dialog
- Owner: bamlab
- License: mit
- Created: 2016-08-31T14:56:51.000Z (almost 10 years ago)
- Default Branch: master
- Last Pushed: 2018-02-09T00:13:19.000Z (over 8 years ago)
- Last Synced: 2025-05-17T23:07:49.337Z (about 1 year ago)
- Language: Java
- Homepage:
- Size: 20.5 KB
- Stars: 26
- Watchers: 3
- Forks: 11
- Open Issues: 4
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# react-native-numberpicker-dialog
Show an Android modal dialog with a list of choices displayed using a `android.widget.NumberPicker`.

This is only for Android. There is the built-in [React Native Picker component](https://facebook.github.io/react-native/docs/picker.html) for iOS. It works for Android too, but display a dialog (or dropdown) with a long list of choices that can be confusing.
## Setup
Install the package with React Native:
```
react-native install react-native-numberpicker-dialog
```
## Usage example
```javascript
import NumberPickerDialog from 'react-native-numberpicker-dialog';
NumberPickerDialog.show({
values: ['First item', 'Second item', 'Third item'],
positiveButtonLabel: 'Ok',
negativeButtonLabel: 'Cancel',
message: 'What would you like to have?',
title: 'Nice dialog',
}).then((id) => {
// id is the index of the chosen item, or -1 if the user cancelled.
});
```
## Other open-source modules by the folks at [BAM](http://github.com/bamlab)
* [react-native-image-resizer](https://github.com/bamlab/react-native-image-resizer)
* [rn-camera-roll](https://github.com/bamlab/rn-camera-roll)
* [react-native-animated-picker](https://github.com/bamlab/react-native-animated-picker)
* [cordova-plugin-native-routing](https://github.com/bamlab/cordova-plugin-native-routing)