All Projects → bamlab → react-native-numberpicker-dialog

bamlab / react-native-numberpicker-dialog

Licence: MIT license
Show a dialog on Android, allowing to choose an option using NumberPicker

Programming Languages

java
68154 projects - #9 most used programming language
javascript
184084 projects - #8 most used programming language

react-native-numberpicker-dialog

Show an Android modal dialog with a list of choices displayed using a android.widget.NumberPicker.

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 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

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

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].