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

perfect-toast

v0.1.0

Published

A Perfect Dark-inspired toast notification library with directional fade animations

Readme

Perfect Toast

A Perfect Dark-inspired toast notification library with directional gradient sweep animations.

Features

  • Directional color gradient reveal animation (like Perfect Dark's HUD)
  • 9-point positioning grid
  • 4 built-in color themes + custom hex support
  • Light/dark mode support
  • Pause on hover, click to dismiss
  • TypeScript support
  • Zero dependencies, ~3KB gzipped

Installation

npm install perfect-toast
yarn add perfect-toast
pnpm add perfect-toast

Quick Start

import { toast } from 'perfect-toast';

// Simple toast
toast('Objective complete.');

// Themed shortcuts
toast.success('Mission complete.');
toast.info('New intel received.');
toast.error('Connection lost.');
toast.warning('Low ammunition.');

API

toast(message, options?)

Show a toast notification.

const id = toast('Hello world', {
  theme: 'green',
  position: 'bottom-left',
  direction: 'left',
  duration: 4000,
});

Themed Shortcuts

toast.success(message, options?)  // green theme
toast.info(message, options?)     // cyan theme
toast.error(message, options?)    // red theme
toast.warning(message, options?)  // amber theme

Management

toast.dismiss(id)      // Dismiss specific toast
toast.dismissAll()     // Dismiss all toasts
toast.update(id, { message: 'Updated!' })  // Update toast message

Configuration

Set global defaults:

toast.configure({
  position: 'bottom-left',
  theme: 'green',
  duration: 4000,
  direction: 'left',
  mode: 'auto',
});

Options

| Option | Type | Default | Description | |--------|------|---------|-------------| | theme | 'green' \| 'cyan' \| 'red' \| 'amber' \| string | 'green' | Color theme or custom hex | | position | Position | 'bottom-left' | Screen position (9-point grid) | | mode | 'dark' \| 'light' \| 'auto' | 'auto' | Background mode | | direction | 'left' \| 'right' \| 'up' \| 'down' | 'left' | Animation sweep direction | | duration | number | 4000 | Auto-dismiss time in ms (0 = persistent) | | animationSpeed | number | 400 | Reveal animation duration in ms | | dismissible | boolean | true | Click to dismiss | | pauseOnHover | boolean | true | Pause timer on hover | | onShow | () => void | - | Callback when toast appears | | onDismiss | () => void | - | Callback when toast is dismissed |

Positions

9-point positioning grid:

top-left      top-center      top-right
middle-left   middle-center   middle-right
bottom-left   bottom-center   bottom-right

Global Config Options

Additional options available via toast.configure():

| Option | Type | Default | Description | |--------|------|---------|-------------| | fontFamily | string | 'Courier New', Consolas, monospace | Toast font | | fontSize | number | 14 | Font size in pixels | | margin | number | 16 | Margin from screen edges | | gap | number | 6 | Gap between stacked toasts | | maxVisible | number | 5 | Max visible toasts (0 = unlimited) |

Color Themes

| Theme | Color | Use Case | |-------|-------|----------| | green | #00ff00 | Success, confirmations | | cyan | #00ccff | Info, neutral messages | | red | #ff3333 | Errors, warnings | | amber | #ffcc00 | Cautions, alerts |

Custom hex colors are also supported:

toast('Custom color!', { theme: '#ff00ff' });

Browser Support

  • Chrome 85+
  • Firefox 75+
  • Safari 15.4+
  • Edge 85+

Requires CSS @property support for smooth gradient animations.

License

MIT