# react-native-simplest-alert

> Just call a function to show your alert. No need for jsx. Works on ios, android, and the web. Supports multi alerts at the same time.

Latest version **1.0.6** (published 2022-06-29) · MIT license · 0 weekly downloads

## Install

```sh
npm install react-native-simplest-alert
pnpm add react-native-simplest-alert
yarn add react-native-simplest-alert
bun add react-native-simplest-alert
```

## Health

**Score 15/100 (F)** — status: abandoned.

Positive: no vulnerabilities.

Warnings: low downloads; no types; no esm support.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 1.0.6 |
| Published | 2022-06-29 |
| First published | 2022-06-28 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 0 |
| Unpacked size | 6.8 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 0 |
| Author | Nitsan BenHanoch |
| Maintainers | nitsanbh |
| Keywords | react-native, alert, popup, pop-up |

## Links

- npm: https://www.npmjs.com/package/react-native-simplest-alert
- Repository: https://github.com/nitasn/react-native-simplest-alert
- Homepage: https://github.com/nitasn/react-native-simplest-alert#readme
- Issues: https://github.com/nitasn/react-native-simplest-alert/issues
- npm.io page: https://npm.io/package/react-native-simplest-alert

## Alternatives

- [react-native-root-siblings](https://npm.io/package/react-native-root-siblings.md) — 102.9K weekly downloads
- [post-robot](https://npm.io/package/post-robot.md) — 93.7K weekly downloads
- [@praxisui/dialog](https://npm.io/package/@praxisui/dialog.md) — 2.0K weekly downloads
- [easy-toggle-state](https://npm.io/package/easy-toggle-state.md) — 350 weekly downloads
- [ngx-lightbox-evp](https://npm.io/package/ngx-lightbox-evp.md) — 19 weekly downloads

## Recent versions

- 1.0.6 (latest) — 2022-06-29
- 1.0.5 — 2022-06-29
- 1.0.4 — 2022-06-29
- 1.0.3 — 2022-06-29
- 1.0.2 — 2022-06-28
- 1.0.1 — 2022-06-28
- 1.0.0 — 2022-06-28

## README

# React Native Simplest Alert

Display an alert with a simple function call:

```
showAlert({
  header: 'Some Title',
  body: 'This is the body of the message.',
});
```

![Screen Capture Gif](https://raw.githubusercontent.com/nitasn/react-native-simplest-alert/master/assets/show-case-small.gif)

No Need for JSX or "isAlertShown" props.

---
 
Optionally, you can pass an `onClose`:
```
showAlert({
  header: 'Posted!',
  body: 'Your post was posted. Click OK to proceed',
  onClose: () => navigation.navigate("SomePage"),
});
```

## How To Use

Wrap your app inside an `<AlertProvider>` tag:

```
import { AlertProvider } from 'react-native-simplest-alert';

export default function App() {
  return (
    <AlertProvider>
      {/* your code... */}
    </AlertProvider>
  );
}
```
  
Anywhere in your application:
```
import { showAlert } from 'react-native-simplest-alert';
  
function onPanic() {
  showAlert({
    header: 'Troll! In the Dungeon!',
    body: 'Thought you ought to know',
    backgroundColor: 'darkred',
    buttonBgColor: 'red',
  });
}
```

---
_Source: https://npm.io/package/react-native-simplest-alert · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
