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

@softon/smart-toast

v1.0.8

Published

A modern toast notification library with SVG icons and gradient backgrounds.

Readme

Smart Toast

A lightweight, dependency-free JavaScript toast notification library with a modern UI, automatic CSS injection, and zero configuration.

Smart Toast is designed to be simple to use while remaining highly customizable. It works in modern browsers without requiring any external CSS files or additional UI frameworks.


Features

  • ✨ Beautiful modern toast notifications

  • 🎨 Automatic CSS injection (no separate CSS file required)

  • 🚀 Lightweight and fast

  • 📦 Works with npm and CDN

  • 📱 Responsive design

  • 🎯 Four built-in notification types

    • Success
    • Error
    • Warning
    • Info
  • 📍 Multiple display positions

  • ⏱ Custom duration

  • 📊 Animated progress bar

  • 🖱 Pause timer on hover

  • ❌ Close button

  • 🔒 HTML escaping by default for improved security

  • 🔁 Optional page reload after notification

  • 🌐 Optional redirect after notification

  • 📚 Queue support for multiple notifications

  • ♿ Accessible (role="alert" and aria-live)

  • 🎨 Theme-safe class names to avoid CSS conflicts


Installation

npm

npm install @softon/smart-toast

CDN

Use the published UMD build directly in a browser:

<script src="https://cdn.jsdelivr.net/npm/@softon/smart-toast/dist/smart-toast.umd.js"></script>

Plain HTML Example

<!doctype html>
<html>
<head>
  <meta charset="utf-8" />
  <title>Smart Toast Demo</title>
</head>
<body>
  <button onclick="SmartToast.toast({ status: 'success', message: 'Hello from CDN!' })">
    Show Toast
  </button>

  <script src="https://cdn.jsdelivr.net/npm/@softon/smart-toast/dist/smart-toast.umd.js"></script>
  <script>
    SmartToast.config({
      duration: 3000,
      position: 'top-right'
    });
  </script>
</body>
</html>

Basic Usage

Browser / CDN

SmartToast.toast({
    status: "success",
    message: "Record saved successfully."
});

ESM Import

import SmartToast from '@softon/smart-toast';

SmartToast.toast({
    status: "success",
    message: "Record saved successfully."
});

Available Status Types

success
error
warning
info

Example:

SmartToast.toast({
    status: "error",
    message: "Invalid username or password."
});

Configuration

Set global defaults once.

SmartToast.config({
    duration: 4000,
    position: "top-right",
    maxToasts: 5,
    pauseOnHover: true,
    progressBar: true
});

Toast Options

SmartToast.toast({

    status: "success",

    message: "Saved successfully.",

    duration: 3000,

    position: "top-right",

    reload: false,

    url: null

});

Options

| Option | Type | Default | Description | | -------- | ------------- | ------------- | -------------------------------------------------- | | status | String | "info" | Toast type (success, error, warning, info) | | message | String | "" | Notification message | | duration | Number | 4000 | Auto close time (milliseconds) | | position | String | "top-right" | Display position | | reload | Boolean | false | Reload page after toast closes | | url | String | null | null | Redirect after toast closes |


| Option | Type | Default | Description | | --- | --- | --- | --- | | message | string | "Message Content" | Text shown in toast | | status | string | "info" | success, error, warning, info | | duration | number | 4000 | Auto-dismiss time (ms) | | reload | boolean | false | Reload page after dismiss | | url | string | null | Redirect after dismiss | | position | string | "top-right" | top-left, top-right, bottom-left, bottom-right, center |

Supported Positions

top-left

top-right

bottom-left

bottom-right

center

Progress Bar

Enable a smooth animated progress bar that automatically counts down the remaining display time.


Pause on Hover

When the cursor is placed over a toast notification, the countdown pauses automatically and resumes when the cursor leaves.


HTML Escaping

For security, notification messages are escaped by default to prevent unintended HTML rendering.


Multiple Toasts

Smart Toast supports multiple notifications simultaneously.

Notifications are displayed in a clean stack, and queued automatically when the configured limit is reached.


Browser Support

Supports all modern browsers including:

  • Chrome
  • Edge
  • Firefox
  • Safari
  • Opera

Examples

SmartToast.toast({
    status: "success",
    message: "Profile updated successfully."
});
SmartToast.toast({
    status: "warning",
    message: "Your session will expire soon."
});
SmartToast.toast({
    status: "error",
    message: "Unable to connect to the server."
});
SmartToast.toast({
    status: "info",
    message: "A new update is available."
});

Why Smart Toast?

Unlike many notification libraries, Smart Toast is designed to work with a single JavaScript file.

There is no need to include additional CSS files because the required styles are injected automatically when the library loads.

Its unique class names are designed to minimize conflicts with existing themes and CSS frameworks, making it suitable for integration into existing projects.


License

MIT License


Contributing

Contributions, bug reports, feature requests, and pull requests are welcome.

If you find a bug or have an idea for improvement, please open an issue on GitHub.


Author

Developed with ❤️ by the LNT Software.