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 🙏

© 2026 – Pkg Stats / Ryan Hefner

ui-notify

v1.0.0

Published

simple and pure javascript toast component

Downloads

5

Readme

ui-notify

simple and pure javascript toast component

综述

  • 版本:1.0.0
  • 浏览器支持:h5所有浏览器 ie9+

安装

通过script标签直接引入

<script src="./ui-notify"></script>
window.Notify;

commonJs引入

var Notify = require('ui-notify');

使用方法


// alert提示框
Notify.alert('这是一个提示');

// toast提示框
Notify.toast('消息');

// confirm提示框
Notify.confirm({
    title: '是否删除',
    left: '删除',
    right: '取消',
    modal: false, // 是否有遮罩层
    fn: function () {
        // 点击删除执行的回调
    }
});

methods

alert

Notify.alert(msg)

| 参数 | 类型 | 说明 | 默认值 | | :--- | :--- | :--- | :--- | | msg* | String | 消息文字 | "" |

toast

Notify.toast('消息')
Notify.toast('消息', { 
    class: 'myClassName',
    fn: function () {
        // toast 消失了
    }
})

| 参数 | 类型 | 说明 | 默认值 | | :--- | :--- | :--- | :--- | | msg | String | 消息文字 | "" | | config(可选) | Object | 配置 | - | | config.class(可选) | String | 给DOM添加class,从而实现覆盖默认样式 | - | | config.fn(可选) | Function | toast消失时的回调 | - |

confirm

Notify.confirm({    
    title: '是否删除',
    right: '删除',
    left: '取消',
    modal: false,
    class: 'myConfirm',
    fn: function (msg) {
        // 点击执行的回调
        if (msg === 'success') {
            // 点击确认
        } else if (msg === 'fail') {
            // 点击取消
        }
    }
});

| 参数 | 类型 | 说明 | 默认值 | | :--- | :--- | :--- | :--- | | title | String | 消息文字 | "" | | modal(可选) | Boolean | 是否使用遮罩 | false | | right(可选) | String | 确认按钮文字 | 确认 | | left(可选) | String | 取消按钮文字 | 取消 | | class(可选) | String | 给DOM添加class,从而实现覆盖默认样式 | - | | fn(可选) | Function | 点击确定按钮的回调 | - |