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

seen-toast

v1.0.0

Published

Modern, lightweight and customizable toast notification library.

Readme

SeenToast

Minimal, modern and customizable toast notification library built with TypeScript.

Features

  • Lightweight
  • TypeScript support
  • Zero dependencies
  • Multiple positions
  • Light and dark themes
  • Auto dismiss
  • Pause on hover
  • Animated progress bar
  • Action buttons
  • Closable notifications
  • Stack management
  • CDN support
  • Fully customizable

Installation

npm

npm install seentoast

pnpm

pnpm add seentoast

yarn

yarn add seentoast

Usage

ESM / Bundlers

import Seen from "seentoast";

Seen.toast({
  message: "Hello world"
});

CDN Usage

<link rel="stylesheet" href="https://unpkg.com/seentoast/dist/seentoast.css">

<script src="https://unpkg.com/seentoast/dist/seentoast.umd.js"></script>

<script>
  Seen.toast({
    message: "Hello from CDN"
  });
</script>

SeenToast initializes automatically in browser environments.


Quick Helpers

Seen.toast.success("Saved successfully");

Seen.toast.error("Something went wrong");

Seen.toast.warning("Be careful");

Seen.toast.info("New update available");

Toast Options

Seen.toast({
  title: "Notification",
  message: "Your changes have been saved",
  type: "success",
  theme: "dark",
  position: "top-right",
  duration: 5000,
  pauseOnHover: true,
  closable: true,
  showIcon: true
});

Available Types

type ToastType =
  | "success"
  | "error"
  | "warning"
  | "info";

Available Themes

type ToastTheme =
  | "light"
  | "dark";

Available Positions

type ToastPosition =
  | "top-left"
  | "top-center"
  | "top-right"
  | "bottom-left"
  | "bottom-center"
  | "bottom-right";

Actions

Seen.toast({
  title: "Delete file",
  message: "This action cannot be undone",
  type: "warning",

  actions: [
    {
      label: "Cancel",
      onClick: () => {
        console.log("Cancelled");
      }
    },

    {
      label: "Delete",
      className: "danger",
      onClick: () => {
        console.log("Deleted");
      }
    }
  ]
});

Action buttons automatically stay grouped on a single row and wrap only when necessary.


Manual Dismiss

const notification = Seen.toast({
  message: "Uploading..."
});

notification.dismiss();

Update Toast

const notification = Seen.toast({
  message: "Uploading..."
});

notification.update({
  message: "Upload completed",
  type: "success"
});

Infinite Toast

Set duration to 0.

Seen.toast({
  message: "Persistent notification",
  duration: 0
});

Progress Bar

The progress bar is automatically displayed when:

duration >= 2000

Short-lived notifications do not display a progress bar.

The progress bar automatically syncs with the remaining toast lifetime.


Pause On Hover

Seen.toast({
  message: "Hover me",
  pauseOnHover: true
});

When the user hovers the toast:

  • the dismiss timer pauses
  • the progress bar pauses
  • the remaining duration is preserved
  • the timer resumes on mouse leave

Hide Icon

Seen.toast({
  message: "No icon",
  showIcon: false
});

Disable Close Button

Seen.toast({
  message: "Not closable",
  closable: false
});

Clear Notifications

Clear all

Seen.clearAll();

Clear by position

Seen.clearPosition("top-right");

Lifecycle Callbacks

Seen.toast({
  message: "Hello",

  onShow: (id) => {
    console.log("shown", id);
  },

  onDismiss: (id) => {
    console.log("dismissed", id);
  }
});

Styling

You can fully customize the appearance using CSS.

Main classes:

.seen-container
.seen-toast

.seen-toast.light
.seen-toast.dark

.seen-toast.success
.seen-toast.error
.seen-toast.warning
.seen-toast.info

.progress-bar
.close-btn

.actions
.action-btn

Example

import Seen from "seentoast";

Seen.toast.success("Profile updated");

Seen.toast({
  title: "Session expired",
  message: "Please login again",
  type: "warning",
  theme: "dark",
  position: "top-right",
  duration: 6000,
  closable: true,
  pauseOnHover: true
});

API

Seen.toast

Seen.toast(options: ToastOptions)

Creates a toast notification.

Returns:

{
  dismiss(): void;
  update(options): void;
}

Seen.clearAll

Seen.clearAll(): void

Removes all notifications.


Seen.clearPosition

Seen.clearPosition(position): void

Removes notifications from a specific position.


TypeScript

All types are exported.

import type {
  ToastOptions,
  ToastType,
  ToastTheme,
  ToastPosition
} from "seentoast";

Build Outputs

SeenToast provides multiple builds:

| File | Description | | ------------------ | --------------- | | seentoast.es.js | ES Module build | | seentoast.umd.js | UMD / CDN build | | seentoast.css | Stylesheet |


Browser Support

SeenToast works in all modern browsers supporting:

  • ES2020+
  • CSS backdrop-filter
  • CSS flexbox/grid

License

MIT