Skip to content

Commit 1e11fb0

Browse files
committed
Update README
1 parent c0a06e7 commit 1e11fb0

File tree

2 files changed

+36
-1
lines changed

2 files changed

+36
-1
lines changed

README.md

Lines changed: 36 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,37 @@
1-
# RNNumberPickerDialog
21
# react-native-numberpicker-dialog
2+
3+
Show an Android modal dialog with a list of choices displayed using a `android.widget.NumberPicker`.
4+
5+
![Android modal dialog with a list of choices displayed using a `android.widget.NumberPicker`](docs/preview.png)
6+
7+
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.
8+
9+
## Setup
10+
11+
Install the package with React Native:
12+
```
13+
react-native install react-native-numberpicker-dialog
14+
```
15+
16+
## Usage example
17+
18+
```javascript
19+
import NumberPickerDialog from 'react-native-numberpicker-dialog';
20+
21+
NumberPickerDialog.show({
22+
values: ['First item', 'Second item', 'Third item'],
23+
positiveButtonLabel: 'Ok',
24+
negativeButtonLabel: 'Cancel',
25+
message: 'What would you like to have?',
26+
title: 'Nice dialog',
27+
}).then((id) => {
28+
// id is the index of the chosen item, or -1 if the user cancelled.
29+
});
30+
```
31+
32+
## Other open-source modules by the folks at [BAM](http://github.com/bamlab)
33+
34+
* [react-native-image-resizer](https://github.com/bamlab/react-native-image-resizer)
35+
* [rn-camera-roll](https://github.com/bamlab/rn-camera-roll)
36+
* [react-native-animated-picker](https://github.com/bamlab/react-native-animated-picker)
37+
* [cordova-plugin-native-routing](https://github.com/bamlab/cordova-plugin-native-routing)

docs/preview.png

15.9 KB
Loading

0 commit comments

Comments
 (0)