Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

react-custom-toast

Package Overview
Dependencies
Maintainers
1
Versions
15
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

react-custom-toast - npm Package Compare versions

Comparing version 0.1.1 to 0.1.2

6

package.json
{
"name": "react-custom-toast",
"version": "0.1.1",
"version": "0.1.2",
"main": "lib/index.umd.js",

@@ -19,2 +19,6 @@ "types": "lib/index.d.ts",

],
"repository": {
"type": "git",
"url": "git@github.com:zhzxang/react-custom-toast.git"
},
"scripts": {

@@ -21,0 +25,0 @@ "dev": "webpack-dev-server --mode=development --config build/dev.js --port 3010 --open",

18

README.md
# react-custom-toast
基于 react 的 toast 组件。可以完全的自定义样式。并提供了内置动画与控制方法
### Feature
* 添加测试
* 上线 demo 网站
* 更多的内置动画效果
### 安装

@@ -48,12 +54,14 @@

`Toast(msg: string, opt: ToastOption)` // 打开`默认`
`Toast(msg: string, opt: ToastOption)` // 打开`默认`提示
`Toast.open(msg: string, opt: ToastOption)` // 打开`默认`
`Toast.open(msg: string, opt: ToastOption)` // 打开无状态提示
`Toast.info(msg: string, opt: ToastOption)` // 打开`提示`
`Toast.info(msg: string, opt: ToastOption)` // 打开提示
`Toast.error(msg: string, opt: ToastOption)` // 打开`错误`
`Toast.info(msg: string, opt: ToastOption)` // 打开`成功`提示
`Toast.warning(msg: string, opt: ToastOption)` // 打开`警告`
`Toast.error(msg: string, opt: ToastOption)` // 打开`错误`提示
`Toast.warning(msg: string, opt: ToastOption)` // 打开`警告`提示
`Toast.remove(id: ToastId)` // 移除某个toast

@@ -60,0 +68,0 @@

@@ -20,2 +20,10 @@ import event from './event'

const info = (message: string = '', option: ToastOption = defaultOption) => {
event.add({
...option,
message,
type: 'info'
})
}
const error = (message: string = '', option: ToastOption = defaultOption) => {

@@ -29,2 +37,10 @@ event.add({

const warning = (message: string = '', option: ToastOption = defaultOption) => {
event.add({
...option,
message,
type: 'warning'
})
}
const success = (message: string = '', option: ToastOption = defaultOption) => {

@@ -44,7 +60,9 @@ event.add({

open,
info,
success,
warning,
error,
remove
remove,
})
export default toast
SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc