Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/shimohq/react-native-prompt-android
A polyfill library for Alert.prompt on Android platform, working both on Android and iOS platform.
https://github.com/shimohq/react-native-prompt-android
android prompt react-native
Last synced: about 4 hours ago
JSON representation
A polyfill library for Alert.prompt on Android platform, working both on Android and iOS platform.
- Host: GitHub
- URL: https://github.com/shimohq/react-native-prompt-android
- Owner: shimohq
- License: mit
- Created: 2016-10-12T04:04:45.000Z (over 8 years ago)
- Default Branch: master
- Last Pushed: 2021-01-19T03:06:13.000Z (almost 4 years ago)
- Last Synced: 2025-01-04T23:14:55.034Z (7 days ago)
- Topics: android, prompt, react-native
- Language: Java
- Homepage:
- Size: 180 KB
- Stars: 130
- Watchers: 9
- Forks: 76
- Open Issues: 32
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
- awesome-react-native-native-modules - react-native-prompt-android ★53
README
# react-native-prompt-android
A polyfill library for Alert.prompt on Android platform, working both on Android and iOS platform(iOS using [AlertIOS.prompt](http://facebook.github.io/react-native/docs/alertios.html#prompt))### Installation
* Install from npm
```bash
npm i react-native-prompt-android --save
```* Link native library
You can use react-native-cli:
```bash
react-native link react-native-prompt-android
```Or rnpm:
```bash
rnpm link react-native-prompt-android
```### Usage
```
import prompt from 'react-native-prompt-android';
prompt(
'Enter password',
'Enter your password to claim your $1.5B in lottery winnings',
[
{text: 'Cancel', onPress: () => console.log('Cancel Pressed'), style: 'cancel'},
{text: 'OK', onPress: password => console.log('OK Pressed, password: ' + password)},
],
{
type: 'secure-text',
cancelable: false,
defaultValue: 'test',
placeholder: 'placeholder'
}
);
```## Props
name | description | type | default
:-------------------- |:------------------------------------------- | --------:|:------------------
type | Text input type: `'numeric', 'secure-text', 'phone-pad', 'email-address'` | String | 'default'
cancelable | | Boolean |
defaultValue | Default input value | String | ''
keyboardType | The keyboard type of first text field(if exists). One of `'default'`, `'email-address'`, `'numeric'`, `'phone-pad'`, `'ascii-capable'`, `'numbers-and-punctuation'`, `'url'`, `'number-pad'`, `'name-phone-pad'`, `'decimal-pad'`, `'twitter'` or `'web-search'`. | String | 'default'
placeholder | | String | ''![Android Screen Shoot](./Example/android.png)
![Android Screen Shoot](./Example/ios.png)