# universal-alert

> Alert component for feedback.

Latest version **1.2.1** (published 2020-07-29) · BSD-3-Clause license · 0 weekly downloads

## Install

```sh
npm install universal-alert
pnpm add universal-alert
yarn add universal-alert
bun add universal-alert
```

## Health

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

Positive: has types; no vulnerabilities.

Warnings: low downloads; no esm support.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 1.2.1 |
| Published | 2020-07-29 |
| First published | 2016-11-04 |
| Weekly downloads | 0 |
| License | BSD-3-Clause |
| TypeScript types | bundled |
| Module format | CommonJS |
| Dependencies | 1 |
| Unpacked size | 36.5 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 270 |
| Author | rax |
| Maintainers | rax-publisher, yuanyan, zeroling |
| Keywords | Rax |

## Links

- npm: https://www.npmjs.com/package/universal-alert
- Repository: https://github.com/raxjs/universal-api
- Homepage: https://github.com/raxjs/universal-api#readme
- Issues: https://github.com/raxjs/universal-api/issues
- npm.io page: https://npm.io/package/universal-alert

## Dependencies (1)

- [universal-env](https://npm.io/package/universal-env.md) ^3.0.0

## Recent versions

- 1.2.1 (latest) — 2020-07-29
- 2.0.0-beta (beta) — 2021-01-12
- 1.2.1-0 — 2020-07-09
- 1.2.0 — 2020-05-25
- 1.1.0 — 2020-04-21
- 1.0.2 — 2019-12-16
- 1.0.1-beta.2 — 2019-11-04
- 1.0.1-beta.1 — 2019-11-01
- 1.0.1 — 2019-08-05
- 1.0.0 — 2019-07-11
- 1.0.0-beta.2 — 2019-06-21
- 1.0.0-beta.1 — 2019-05-30
- 0.0.0 — 2016-11-04

## README

# universal-alert [![npm](https://img.shields.io/npm/v/universal-alert.svg)](https://www.npmjs.com/package/universal-alert)

Alert component for feedback.


## Support
<img alt="browser" src="https://gw.alicdn.com/tfs/TB1uYFobGSs3KVjSZPiXXcsiVXa-200-200.svg" width="25px" height="25px" /> <img alt="weex" src="https://gw.alicdn.com/tfs/TB1jM0ebMaH3KVjSZFjXXcFWpXa-200-200.svg" width="25px" height="25px" /> <img alt="miniApp" src="https://gw.alicdn.com/tfs/TB1bBpmbRCw3KVjSZFuXXcAOpXa-200-200.svg" width="25px" height="25px" /> <img alt="wechatMiniprogram" src="https://img.alicdn.com/tfs/TB1slcYdxv1gK0jSZFFXXb0sXXa-200-200.svg" width="25px" height="25px"> <img alt="quickApp" src="https://gw.alicdn.com/tfs/TB1MP7EwQT2gK0jSZPcXXcKkpXa-200-200.svg" width="25px" height="25px"> <img alt="bytedanceMicroApp" src="https://gw.alicdn.com/tfs/TB1jFtVzO_1gK0jSZFqXXcpaXXa-200-200.svg" width="25px" height="25px">

## Install

```bash
$ npm install universal-alert --save
```

## Usage

```js
import Alert from 'universal-alert';

// How to use it in quickapp
// import Alert from 'universal-alert/lib/quickapp;

Alert({
  title: 'alert title',
  content: 'alert content',
  buttonText: 'button text，default value is confirm'
}).then(() => {
  console.log('confirm');
});
```

## Methods

### `Alert(options)`

#### Arguments

| Property           | Type     | Description                                           |  Default  |  Supported   |
| ------------------ | -------- | ----------------------------------------------------- | :-------: | :----------: |
| options            | `object` | alert arguments                                       |     -     |              |
| options.title      | `string` | alert title，support only in mini app                 |  -  |     <img alt="miniApp" src="https://gw.alicdn.com/tfs/TB1bBpmbRCw3KVjSZFuXXcAOpXa-200-200.svg" width="25px" height="25px" /> <img alt="wechatMiniprogram" src="https://img.alicdn.com/tfs/TB1slcYdxv1gK0jSZFFXXb0sXXa-200-200.svg" width="25px" height="25px"> <img alt="quickApp" src="https://gw.alicdn.com/tfs/TB1MP7EwQT2gK0jSZPcXXcKkpXa-200-200.svg" width="25px" height="25px"> <img alt="bytedanceMicroApp" src="https://gw.alicdn.com/tfs/TB1jFtVzO_1gK0jSZFqXXcpaXXa-200-200.svg" width="25px" height="25px"> |
| options.content    | `string` | alert content                                         | - |              |
| options.buttonText | `string` | alert button text，web environments are not supported | - | <img alt="weex" src="https://gw.alicdn.com/tfs/TB1jM0ebMaH3KVjSZFjXXcFWpXa-200-200.svg" width="25px" height="25px" /> <img alt="miniApp" src="https://gw.alicdn.com/tfs/TB1bBpmbRCw3KVjSZFuXXcAOpXa-200-200.svg" width="25px" height="25px" /> <img alt="wechatMiniprogram" src="https://img.alicdn.com/tfs/TB1slcYdxv1gK0jSZFFXXb0sXXa-200-200.svg" width="25px" height="25px"> <img alt="quickApp" src="https://gw.alicdn.com/tfs/TB1MP7EwQT2gK0jSZPcXXcKkpXa-200-200.svg" width="25px" height="25px"> <img alt="bytedanceMicroApp" src="https://gw.alicdn.com/tfs/TB1jFtVzO_1gK0jSZFqXXcpaXXa-200-200.svg" width="25px" height="25px"> |

#### Attention

Options that only supported by WeChat MiniProgram like `confirmColor` can also be passed but will not effect in other miniapp platforms.

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