Research
Security News
Quasar RAT Disguised as an npm Package for Detecting Vulnerabilities in Ethereum Smart Contracts
Socket researchers uncover a malicious npm package posing as a tool for detecting vulnerabilities in Etherium smart contracts.
一个基于react的提示组件,可以弹出文字,图片,图标,以及显示loading
npm install ac-toast -S
import Toast from 'ac-toast';
import 'ac-toast/dist/ac-toast.css';
Toast.info({
msg: '提交成功',
duration: 3000,
transition: 'fade',
icon: 'success',
className: 'submit-success'
});
更多用法可以参考demo文件夹中的示例
Parameter | Type | Default | Description |
---|---|---|---|
id | string | 随机字符串 | toast组件的id |
msg | string | 组件中显示的文字 | |
className | string | 组件顶层的class,用来自定义样式 | |
horizontal | string | center | 组件的水平位置。有3个预置选项: center ,left ,right |
vertical | string | middle | 组件的竖直位置。有3个预置选项: middle ,top ,bottom |
duration | number | 2000 | 组件显示时间,单位毫秒 |
mode | string | override | 多个组件连续弹出显示模式。内置的模式有: override ,queue ,layout 。override 模式, 最后显示的toast会强制覆盖前面的。queue 模式, toast排队显示,一个消失,才显示下一个。layout 模式,toast会在竖直方向上排列,不覆盖 |
transition | string | fade | toast组件显示和消失的过渡效果,预置的过渡有: fade |
zIndex | number | 9999 | 组件的层级 |
onClose | function | 组件关闭后的回调 |
Name | Parameter | return Value | Description |
---|---|---|---|
info | above | 默认的黑色背景弹出消息 | |
success | above | 绿色背景弹出成功消息 | |
warning | above | 黄色背景弹出警告消息 | |
error | above | 红色背景弹出错误消息 | |
close | id:toast's id | 关闭指定id的toast | |
closeAll | 关闭所有的toast |
FAQs
react toast component
We found that ac-toast demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Research
Security News
Socket researchers uncover a malicious npm package posing as a tool for detecting vulnerabilities in Etherium smart contracts.
Security News
Research
A supply chain attack on Rspack's npm packages injected cryptomining malware, potentially impacting thousands of developers.
Research
Security News
Socket researchers discovered a malware campaign on npm delivering the Skuld infostealer via typosquatted packages, exposing sensitive data.