https://github.com/leecade/react-native-alert
Use AlertIOS as a simple way just like native javascript.
https://github.com/leecade/react-native-alert
Last synced: 12 months ago
JSON representation
Use AlertIOS as a simple way just like native javascript.
- Host: GitHub
- URL: https://github.com/leecade/react-native-alert
- Owner: leecade
- Created: 2015-04-14T18:36:42.000Z (about 11 years ago)
- Default Branch: master
- Last Pushed: 2016-11-07T16:30:55.000Z (over 9 years ago)
- Last Synced: 2025-07-07T11:41:34.585Z (about 1 year ago)
- Language: JavaScript
- Size: 2.93 KB
- Stars: 7
- Watchers: 3
- Forks: 4
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# react-native-alert
[](http://badge.fury.io/js/react-native-alert)
Use [AlertIOS](http://facebook.github.io/react-native/docs/alertios.html#content) as a simple way just like native javascript.
## INSTALL
```bash
$ npm i react-native-alert --save
```
## USAGE
```javascript
var alert = require('react-native-alert')
// Simple way
alert('123')
alert(123) // Number is allowed
// With title
alert('123', 'title')
// With buttons
alert('123', ['button'])
alert('123', ['button', {text: 'alertButton', onPress: () => alert('ok')}])
// Complete usage
alert('title', '123', [
{text: 'Foo', onPress: () => console.log('Foo Pressed!')},
{text: 'Bar', onPress: () => console.log('Bar Pressed!')},
])
// Or just tell the button text
alert('title', '123', ['btn1', 'btn2', {text: 'Bar', onPress: () => console.log('Bar Pressed!')}])
```