# toast-react

> a plugin of toast for react by typescript

Latest version **1.0.0** (published 2020-06-08) · ISC license · 0 weekly downloads

## Install

```sh
npm install toast-react
pnpm add toast-react
yarn add toast-react
bun add toast-react
```

## 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.0 |
| Published | 2020-06-08 |
| First published | 2020-06-08 |
| Weekly downloads | 0 |
| License | ISC |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 12 |
| Unpacked size | 29.3 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| Author | xc |
| Maintainers | xiechong |
| Keywords | react, toast, typescript |

## Links

- npm: https://www.npmjs.com/package/toast-react
- Repository: https://github.com/xiechong/toast-react
- Homepage: https://github.com/xiechong/toast-react.git#readme
- Issues: https://github.com/xiechong/toast-react.git/issues
- npm.io page: https://npm.io/package/toast-react

## Dependencies (12)

- [react](https://npm.io/package/react.md) ^16.8.6
- [ts-node](https://npm.io/package/ts-node.md) ^8.3.0
- [react-dom](https://npm.io/package/react-dom.md) ^16.8.6
- [pre-commit](https://npm.io/package/pre-commit.md) ^1.2.2
- [@types/node](https://npm.io/package/@types/node.md) ^12.6.8
- [@types/react](https://npm.io/package/@types/react.md) ^16.8.20
- [@types/webpack](https://npm.io/package/@types/webpack.md) ^4.32.1
- [media-show-card](https://npm.io/package/media-show-card.md) ^1.0.3
- [@types/react-dom](https://npm.io/package/@types/react-dom.md) ^16.8.4
- [react-router-dom](https://npm.io/package/react-router-dom.md) ^5.0.1
- [@types/react-router-dom](https://npm.io/package/@types/react-router-dom.md) ^4.3.4
- [@types/html-webpack-plugin](https://npm.io/package/@types/html-webpack-plugin.md) ^3.2.1

## 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

- 1.0.0 (latest) — 2020-06-08

## README

# toast-react
a plugin of toast for react by typescript

# install 
npm i toast-react

# use
```
 import { openToast } from toast-react;
 openToast('打开toast成功')
```

# option
  ### msg（必填）
  展示内容: 默认为"undefined"
  ### duration 
  展示时间，单位ms:  默认：1500ms
  ### position
  展示位置，可选为"top","center","bottom":  默认："center"  
  ### icon
  带icon的toast，可选为"loading","warn":  默认：""
  ### zindex
  toast在页面的层级:  默认："100"
  ### cd
  toast关闭时的回调方法:  默认：null
    
# methods
### 手动打开toast的方法:
```
openToast('打开toast');
```
### 手动关闭toast的方法:
```
closeToast();
```

 # example
```
openToast('打开toast成功', {
    duration: 3000,
},
function() {console.log('end')});

openToast('打开toast成功', {
    duration: 3000,
    icon: "loading"
});

openToast('打开toast成功', {
    position: "bottom",
    icon: "loading",

});
```

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