npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2025 – Pkg Stats / Ryan Hefner

ac-toast

v0.0.9

Published

react toast component

Downloads

21

Readme

ac-toast

npm version NPM downloads

1. 简介

一个基于react的提示组件,可以弹出文字,图片,图标,以及显示loading

2. 安装

npm install ac-toast -S

3. 使用

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文件夹中的示例

4. 预览

基本消息 图标颜色 图片 loading 错误消息

5. 参数

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,layoutoverride模式, 最后显示的toast会强制覆盖前面的。queue模式, toast排队显示,一个消失,才显示下一个。layout模式,toast会在竖直方向上排列,不覆盖 transition | string | fade | toast组件显示和消失的过渡效果,预置的过渡有: fade zIndex | number | 9999 | 组件的层级 onClose | function | | 组件关闭后的回调

6. 方法

Name | Parameter | return Value | Description --------- | ---------- | -----------|----------- info | above | | 默认的黑色背景弹出消息 success | above | | 绿色背景弹出成功消息 warning | above | | 黄色背景弹出警告消息 error | above | | 红色背景弹出错误消息 close | id:toast's id | | 关闭指定id的toast closeAll | | | 关闭所有的toast