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

robot-toast

v2.1.9

Published

A lightweight, framework-agnostic toast notification library with an animated robot character. Tree-shakeable robots, draggable with swipe-to-dismiss, toast.promise(), and an optional React hook.

Readme

🤖 robot-toast

robot-toast demo

Lightweight toast notifications with complete control.

robot-toast gives you a canvas, not a prescription — bring your own robot, colors, buttons, and timing. 16 tree-shakeable robots, fully draggable, zero dependencies.

🤖 Built-in Robots

Built-in Robots

🎨 Features in Action

Install

npm install robot-toast

Quick Start

import { toast } from "robot-toast";
import { wave } from "robot-toast/robots";

toast({ message: "Hello! 🤖", robotVariant: wave });
toast.success("Operation successful!");
toast.error("Something went wrong");

Features at a Glance

| Robots | Layout | Styling | Behavior | | ----------------------- | ------------------ | --------------------- | --------------------- | | 16 built-in variants | 6 position options | 3 themes | Fully draggable | | Tree-shakeable imports | Auto-queuing | Custom inline styles | Typewriter effect | | Custom images (SVG/PNG) | Progress bar | Transitions (4 types) | Promise helpers | | Custom image paths | Multi-toast queue | CSS overrides | React hook included |


Usage

Basic Usage

import { toast } from "robot-toast";
import { wave, success, error } from "robot-toast/robots";

toast("Simple notification");
toast({ message: "With options", type: "success", robotVariant: wave });
toast.success("Shorthand");

All Options

toast({
  // Content
  message: 'Notification text',

  // Appearance
  type: 'default' | 'info' | 'success' | 'warning' | 'error',
  theme: 'light' | 'dark' | 'colored',
  transition: 'bounce' | 'flip' | 'zoom' | 'slide',
  position: 'top-left' | 'top-center' | 'top-right' |
            'bottom-left' | 'bottom-center' | 'bottom-right',

  // Robot & Styling
  robotVariant: wave | base | success | error | '...' | 'default' | '/path.svg',
  nearScreen: true,
  style: { background: '...', color: '...' },

  // Timing & Behavior
  autoClose: 5000 | false,
  typeSpeed: 30,
  hideProgressBar: false,
  draggable: true,
  pauseOnHover: true,
  pauseOnFocusLoss: true,
  rtl: false,

  // Multi-toast
  limit: 0,
  newestOnTop: false,

  // Buttons & Callbacks
  buttons: [{ label: 'Undo', onClick: () => {...} }],
  onOpen: () => {...},
  onClose: () => {...},
});

Inline Buttons

Add undo/confirm/cancel style buttons to toasts:

toast({
  message: "File deleted",
  buttons: [
    { label: "Undo", onClick: () => restoreFile() },
    { label: "Keep", onClick: () => {}, style: { color: "gray" } },
  ],
});

Promise Lifecycle

Attach loading/success/error messages to any promise:

toast.promise(
  fetch("/api/save").then((r) => r.json()),
  {
    loading: "Saving…",
    success: (data) => `Saved as ${data.name}`,
    error: (err) => `Failed: ${err.message}`,
  },
);

React Bindings

import { useRobotToast, useToastOnMount } from "robot-toast/react";

function App() {
  const toast = useRobotToast();
  return <button onClick={() => toast.success("Saved!")}>Save</button>;
}

function InitBanner() {
  useToastOnMount({ message: "Welcome!", autoClose: false });
  return null;
}

Complete Example

Combine robots, buttons, theming, and promises in one powerful toast:

import { useRobotToast } from "robot-toast/react";
import { success, error, loading } from "robot-toast/robots";

function CompleteExample() {
  const toast = useRobotToast();

  const handleUpload = () => {
    toast.promise(
      fetch("/api/upload").then((r) => r.json()),
      {
        loading: {
          message: "Uploading your file...",
          robotVariant: loading,
          theme: "dark",
        },
        success: {
          message: "File uploaded! Ready to go? 🎉",
          robotVariant: success,
          theme: "colored",
          style: { background: "#10b981", color: "white" },
          buttons: [
            { label: "View", onClick: () => window.open("/files") },
            { label: "Done", onClick: () => {} },
          ],
        },
        error: {
          message: "Upload failed. Try again?",
          robotVariant: error,
          theme: "dark",
          style: { background: "#ef4444" },
          buttons: [{ label: "Retry", onClick: handleUpload }],
        },
      },
    );
  };

  return <button onClick={handleUpload}>Upload File</button>;
}

Programmatic Control

const id = toast("Working…");
toast.closeById(id);
toast.closeAll();

Themes & Custom Styles

toast({ message: "Light", theme: "light" });
toast({ message: "Dark", theme: "dark" });
toast({
  message: "Custom gradient",
  style: {
    background: "linear-gradient(135deg, #667eea, #764ba2)",
    color: "#fff",
    borderRadius: "16px",
  },
});

Accessibility

  • error / warning toasts: role="alert" + aria-live="assertive"
  • Other types: role="status" + aria-live="polite"
  • aria-atomic="true" ensures full message re-announcement
  • Labeled close button for screen readers