# bee-notification

> Notification ui component for react

Latest version **2.0.5** (published 2020-06-22) · MIT license · 0 weekly downloads

## Install

```sh
npm install bee-notification
pnpm add bee-notification
yarn add bee-notification
bun add bee-notification
```

## 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 | 2.0.5 |
| Published | 2020-06-22 |
| First published | 2016-12-15 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Node | >=4.0.0 |
| Dependencies | 6 |
| Unpacked size | 37.1 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 3 |
| Author | Yonyou FED |
| Maintainers | banyudu, bjyxszd, boyuzhou, guoyongfeng, huayingjie, jonyw, kvkens, liushaozhen, liuyk, npm_yx, tinper-bot, whizbz, yangchch, yonyoufed, zhaoyuchief |
| Keywords | react, react-component, bee-notification, iuap-design, tinper-bee, Notification |

## Links

- npm: https://www.npmjs.com/package/bee-notification
- Repository: https://github.com/tinper-bee/bee-notification
- Homepage: https://github.com/tinper-beebee-notification.git
- Issues: https://github.com/tinper-beebee-notification.git/issues
- npm.io page: https://npm.io/package/bee-notification

## Dependencies (6)

- [bee-icon](https://npm.io/package/bee-icon.md) ^1.0.11
- [bee-button](https://npm.io/package/bee-button.md) latest
- [classnames](https://npm.io/package/classnames.md) ^2.2.5
- [bee-animate](https://npm.io/package/bee-animate.md) latest
- [bee-overlay](https://npm.io/package/bee-overlay.md) ^1.0.16
- [tinper-bee-core](https://npm.io/package/tinper-bee-core.md) latest

## Alternatives

- [mobx-react](https://npm.io/package/mobx-react.md) — 2.8M weekly downloads
- [rc-tree](https://npm.io/package/rc-tree.md) — 2.6M weekly downloads
- [@react-oauth/google](https://npm.io/package/@react-oauth/google.md) — 1.3M weekly downloads
- [@wagmi/connectors](https://npm.io/package/@wagmi/connectors.md) — 877.0K weekly downloads
- [vee-validate](https://npm.io/package/vee-validate.md) — 836.4K weekly downloads

## Recent versions

- 2.0.5 (latest) — 2020-06-22
- 2.0.3-alpha.0 (alpha) — 2019-09-23
- 1.1.4 (next) — 2018-10-22
- 2.0.4 — 2020-04-24
- 2.0.3 — 2019-09-23
- 2.0.2 — 2019-05-15
- 2.0.2-alpha.0 — 2019-05-15
- 2.0.1 — 2019-04-29
- 2.0.0 — 2019-02-28
- 1.1.7 — 2018-11-27
- 1.1.6 — 2018-11-13
- 1.1.5 — 2018-10-22
- 1.1.3 — 2018-10-18
- 1.1.2 — 2018-10-08
- 1.1.1 — 2018-09-30
- … 18 more at https://npm.io/package/bee-notification/versions

## README

# bee-notification

[![npm version](https://img.shields.io/npm/v/bee-notification.svg)](https://www.npmjs.com/package/bee-notification)
[![Build Status](https://img.shields.io/travis/tinper-bee/bee-notification/master.svg)](https://travis-ci.org/tinper-bee/bee-notification)
[![Coverage Status](https://coveralls.io/repos/github/tinper-bee/bee-notification/badge.svg?branch=master)](https://coveralls.io/github/tinper-bee/bee-notification?branch=master)


## Browser Support

|![IE](https://raw.github.com/alrra/browser-logos/master/internet-explorer/internet-explorer_48x48.png) | ![Chrome](https://raw.github.com/alrra/browser-logos/master/chrome/chrome_48x48.png) | ![Firefox](https://raw.github.com/alrra/browser-logos/master/firefox/firefox_48x48.png) | ![Opera](https://raw.github.com/alrra/browser-logos/master/opera/opera_48x48.png) | ![Safari](https://raw.github.com/alrra/browser-logos/master/safari/safari_48x48.png)|
| --- | --- | --- | --- | --- |
| IE 9+ ✔ | Chrome 31.0+ ✔ | Firefox 31.0+ ✔ | Opera 30.0+ ✔ | Safari 7.0+ ✔ |


react bee-notification component for tinper-bee

Notification通知不同于操作类型的信息反馈，是一种主动推送的信息。

## 使用方法

```js
let notification = null;
Notification.newInstance({position: 'bottomRight'}, n => notification = n);

class Demo1 extends Component {

    simpleFn() {
      notification.notice({
        content: <span>simple show</span>,
        onClose() {
          console.log('simple close');
        },
      });
    }
    render () {

        return (
            <div className="demoPadding">
                <Button onClick={this.simpleFn}>simple show</Button>
            </div>
        )
    }
}

```

#### 样式引入
- 可以使用link引入build目录下Notification.css
```
<link rel="stylesheet" href="./node_modules/bee-notification/build/Notification.css">
```
- 可以在js中import样式
```js
import "./node_modules/bee-notification/src/Notification.scss"
//或是
import "./node_modules/bee-notification/build/Notification.css"
```

## API

#### Notice

|参数|说明|类型|默认值|
|:---|:-----|:----|:------|
|duration|显示时间|number|4.5|
|onClose|关闭时触发的钩子函数|function|-|
|closable|是否可手动关闭|boolean|true|
|color|显示颜色|success/info/danger/warning/dark|-|
|className|类名|string|-|
|style|样式|object|-|

#### Notification

|参数|说明|类型|默认值|
|:--|:---:|:--:|---:|
|show|是否显示|boolean|true|
|transition|动画|element|Fade|
|position|显示位置|topRight/BottomRight|topRight|
|timeout|延迟时间|number|-|
|onEnter|开始显示时的钩子函数|function|-|
|onEntering|显示时的钩子函数|function|-|
|onEntered|显示完成后的钩子函数|function|-|
|onExit|隐藏开始时的钩子函数|function|-|
|onExiting|隐藏进行时的钩子函数|function|-|
|onExited|隐藏结束时的钩子函数|function|-|
|className|类名|string|-|
|style|样式|object|-|
|keyboard|esc触发关闭|boolean|true|
|onEscapeKeyUp|响应ESC键时的钩子函数|function|-|

#### 已支持的键盘操作

|按键|功能|
|:---|:----|
|esc |关闭Notification|

#### 开发调试

```sh
$ npm install -g bee-tools
$ git clone https://github.com/tinper-bee/bee-notification
$ cd bee-notification
$ npm install
$ npm run dev
```

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