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

infinity-toast

v1.0.0

Published

A lightweight, dependency-free toast notification system

Readme

Modern Toast Notification System

A lightweight, customizable toast notification system for web applications with zero dependencies.

Features

1. Multiple Toast Types

  • ✅ Success (green with checkmark icon)
  • ❌ Error (red with X icon in circle)
  • ⚠️ Warning (orange with inverted "i" in triangle)
  • ℹ️ Info (blue with "i" in circle)

2. Positioning

  • top-right (default)
  • top-left
  • bottom-right
  • bottom-left

3. Progress & Timing

  • Automatic dismiss with configurable duration
  • Visual progress bar
  • Pause on hover (progress bar and timer pause when hovering)
  • Resume on mouse leave

4. Animations

  • Smooth entry animations (slides in from edge)
  • Smooth exit animations
  • Direction-aware animations (slides from right or left based on position)
  • Fade in/out effects

5. Interactive Features

  • Close button with hover effect
  • Manual dismiss through close button only
  • Progress bar indicates remaining time
  • Hover to pause auto-dismiss

6. Customization Options

const toast = new InfinityToast({
    position: 'top-right',         // Position of toasts
    duration: 3000,               // Duration in milliseconds
    showIcon: true,              // Show/hide type icons
    showCloseButton: true,       // Show/hide close button
    containerClass: 'custom-container', // Custom container class
    toastClass: 'custom-toast'   // Custom toast class
});

7. Modern Design

  • Clean, minimal interface
  • Responsive layout
  • Shadow effects
  • Smooth transitions
  • High-contrast icons
  • Accessible colors

Usage

1. Basic Implementation

import toast from './index.js';

// Show different types of notifications
toast.success('Operation completed successfully!');
toast.error('An error occurred!');
toast.warning('Please be careful!');
toast.info('Here is some information.');

2. Custom Instance

import { InfinityToast } from './index.js';

const customToast = new InfinityToast({
    position: 'bottom-right',
    duration: 5000,
    showIcon: true,
    showCloseButton: true
});

customToast.success('Custom toast message!');

3. Multiple Instances

You can create multiple toast instances with different configurations:

const topToast = new InfinityToast({ position: 'top-right' });
const bottomToast = new InfinityToast({ position: 'bottom-left' });

Styling

The toast system includes built-in styles with CSS variables for easy customization:

  • Success color: #4caf50
  • Error color: #f44336
  • Warning color: #ff9800
  • Info color: #2196f3

Each toast type has its own class for custom styling:

  • .infinity-toast.success
  • .infinity-toast.error
  • .infinity-toast.warning
  • .infinity-toast.info

Technical Details

Auto-cleanup

  • Toasts are automatically removed from the DOM after animation
  • Memory-efficient with proper event listener cleanup
  • Smooth animation handling with requestAnimationFrame

Performance

  • Lightweight implementation
  • No external dependencies
  • Efficient DOM operations
  • Hardware-accelerated animations

Browser Support

  • Works in all modern browsers
  • Uses standard web APIs
  • ES6 module support

License

MIT

Author

Created by Dinesh Babu