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

@zzev/toastify

v0.1.0

Published

Toast notifications on the browser

Downloads

6

Readme

@zzev/toastify

A lightweight, elegant toast notification system for the browser with TypeScript support, theme customization, and smooth animations.

npm version TypeScript

✨ Features

  • 🎨 Theme Support - Light, dark, and auto (follows system preferences)
  • 📱 Responsive - Different animations for mobile and desktop
  • 🎭 Smooth Animations - Beautiful fade-in, slide, and fade-out effects
  • 📦 Zero Dependencies - Lightweight and self-contained
  • 🔷 TypeScript Native - Full type safety and IntelliSense support
  • Easy to Use - Simple API with powerful customization options

📦 Installation

npm install @zzev/toastify

🚀 Quick Start

// Option 1: Default export
import Toastify from '@zzev/toastify';

const theme = new Toastify.Theme('dark'); // 'light', 'dark', or null for auto
const toast = new Toastify.Core();

// Option 2: Named exports (recommended)
import { Theme, Core } from '@zzev/toastify';

const theme = new Theme('dark');
const toast = new Core();

// Initialize with your messages
await toast.init({
  styles: theme.styles,
  messages: [
    {
      img: 'https://example.com/logo.png',
      title: 'Welcome!',
      time: 'now',
      text: 'Your notification message here'
    }
  ],
  delays: {
    startAfterMs: 1000,
    displayIntervalMs: 2000,
    fadeOutMs: 5000
  }
});

// Run the toast notifications
toast.run();

📚 API Reference

Core Methods

init(options: ToastifyOptionsProps): Promise<void>

Initializes the toast system with configuration.

Options:

{
  styles: string;           // CSS styles from Theme.styles
  messages: Array<{
    img: string;           // Image URL
    title: string;         // Toast title
    time: string;          // Time string (e.g., "now", "2m ago")
    text: string;          // Message content
  }>;
  delays: {
    startAfterMs: number;      // Delay before first toast (default: 1000)
    displayIntervalMs: number; // Interval between toasts (default: 2000)
    fadeOutMs: number;         // Fade out delay (default: 5000, 0 = no fade)
  };
}

run(): void

Starts displaying the toast notifications.

stop(): void

Stops the current toast sequence and removes all toasts.

destroy(): void

Completely removes all toasts, styles, and cleans up resources.

Theme

new Theme(theme?, mobileSize?)

Creates a new theme instance.

Parameters:

  • theme: 'light' | 'dark' | null - Theme mode (null = auto, follows system)
  • mobileSize: number - Mobile breakpoint in pixels (default: 768)

Properties:

  • styles: Returns the complete CSS styles string
  • rawStyles: Returns the raw CSS styles

Methods:

  • setTheme(theme): Updates the theme

TypeScript Types

import type {
  ToastifyMessageProps,
  ToastifyMessagesProps,
  ToastifyDelaysProps,
  ToastifyOptionsProps,
  ToastifyStylesProps,
  ToastifyThemeMapProps,
  ToastifyThemeProp,
} from '@zzev/toastify';

🎯 Advanced Examples

Custom Delays Configuration

await toast.init({
  styles: theme.styles,
  messages: [...],
  delays: {
    startAfterMs: 500,      // Start after 500ms
    displayIntervalMs: 3000, // 3s between each toast
    fadeOutMs: 0            // No auto fade-out
  }
});

Multiple Toast Messages

const messages = [
  {
    img: '/icons/success.png',
    title: 'Success',
    time: 'now',
    text: 'Operation completed successfully'
  },
  {
    img: '/icons/info.png',
    title: 'Update Available',
    time: '1m ago',
    text: 'A new version is ready to install'
  },
  {
    img: '/icons/warning.png',
    title: 'Warning',
    time: '5m ago',
    text: 'Please review your settings'
  }
];

await toast.init({
  styles: theme.styles,
  messages,
  delays: {
    startAfterMs: 1000,
    displayIntervalMs: 2500,
    fadeOutMs: 4000
  }
});

toast.run();

Cleanup

// Stop and remove all toasts
toast.stop();

// Or completely destroy (removes styles too)
toast.destroy();

🤝 Contributing

Contributions are welcome! Please follow these guidelines:

Reporting Issues

  • Check existing issues before creating a new one
  • Provide a clear description and steps to reproduce
  • Include browser/environment information

Pull Requests

  1. Fork the repository
  2. Create a feature branch (git checkout -b feature/amazing-feature)
  3. Make your changes following the code style
  4. Ensure TypeScript compilation passes (npm run build)
  5. Commit your changes (git commit -m 'Add amazing feature')
  6. Push to your branch (git push origin feature/amazing-feature)
  7. Open a Pull Request

Development Setup

# Clone the repository
git clone https://github.com/zzev/toastify.git

# Install dependencies
npm install

# Build the project
npm run build

Build Commands

# Compile TypeScript to JavaScript
npm run build

# Create minified versions (for releases)
npm run minify

Project Structure

toastify/
├── src/
│   ├── toastify.core.ts    # Core toast functionality
│   └── toastify.theme.ts   # Theme management
├── index.ts                # Main entry point
├── types.ts                # TypeScript type definitions
├── tsconfig.json           # TypeScript configuration
└── package.json            # Package configuration

Code Style

  • Use TypeScript for all new code
  • Follow existing code patterns
  • Maintain type safety
  • Keep code clean and well-documented

📄 License

GPL-3.0 License - see the LICENSE file for details

👤 Author

zzev

🐛 Issues

Found a bug? Please open an issue.