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

d9-toast

v2.6.45

Published

Customizable toast notifications for React

Readme

D9-Toast

npm version npm bundle size npm downloads License React Donate via Razorpay

A lightweight, fully typed, production-ready toast notification library for React — with zero hooks required.


✨ Features

  • Lightweight & Fast – Minimal bundle size
  • 🔒 100% TypeScript – Full IntelliSense & strict typing
  • 🎨 Themes – Light, Dark & Colored
  • 🔔 Audio Support – Per-toast sounds with cooldown
  • 🎯 7 Positions – Flexible placement
  • 🧩 Action Buttons – Undo / Retry / CTA actions
  • Auto / Manual Control
  • 🔄 Promise Toasts – Loading → Success / Error
  • 📚 Stack Depth Animations
  • 🔁 Expand on Hover
  • 🔠 RTL Text Support
  • 🧪 No External Dependencies
  • 📱 Responsive & Accessible

📺 Demo

👉 https://psathul073.github.io/d9-toast-docs/docs/examples/basic


📦 Installation

npm install d9-toast

or

yarn add d9-toast

🚀 Quick Start

1️⃣ Wrap your app with ToastProvider

import { ToastProvider } from "d9-toast";
import "d9-toast/toast.css";

export default function Root() {
  return (
    <ToastProvider>
      <App />
    </ToastProvider>
  );
}

⚠️ Required once at app root


2️⃣ Trigger toasts anywhere (NO HOOKS)

import { toast } from "d9-toast";

// You can call it directly!
const notify = () => toast("Simple notification");

// Or use specific types
const success = () => toast.success("Saved!");

✅ Works inside

  • components
  • utils
  • services
  • async functions

📖 Toast API

import { toast } from "d9-toast";

Available Methods

| Method | Description | | ------------------------------------------- | ------------------- | | toast(msg, options) | Show default toast | | toast.success(msg, options) | Show success toast | | toast.error(msg, options) | Show error toast | | toast.info(msg, options) | Show info toast | | toast.warning(msg, options) | Show warning toast | | toast.promise(promise, messages, options) | Promise-based toast | | toast.dismiss(id) | Remove toast | | toast.dismissAll() | Clear all toasts |


🔧 Toast Options

Core Options

| Option | Type | Description | | ------------------ | -------------------------------------------------------------------------------------------------- | --------------------------- | | message | string \| ReactNode | Toast content | | type | "success" \| "error" \| "info" \| "warning" \| "loading" \| "submit" | Visual type | | theme | "light" \| "dark" \| "colored" | Theme | | position | "top-right" \| top-left \| bottom-right \| bottom-left \| center \| center-top \| center-bottom" | Placement | | duration | number | Auto close (0 = persistent) | | autoClose | boolean | Enable auto close | | closable | boolean | Show close button | | progress | boolean | Progress bar | | title | boolean | Header/title | | pauseOnHover | boolean | Pause on hover | | pauseOnFocusLoss | boolean | Pause on tab switch | | rtl | boolean | RTL text support | | expand | boolean \| "hover" | Expand stacked toasts | | className | string | Custom styles |


🔘 Action Buttons

actions?: {
  text: string;
  className?: string;
  callback?: (toast: { id: string }) => void;
}[];

Example

toast.success("File uploaded", {
  actions: [
    {
      text: "Undo",
      callback: ({ id }) => toast.dismiss(id),
    },
  ],
});

🔄 Promise Toasts (NEW)

toast.promise(
  fetch("/api/save"),
  {
    loading: "Saving...",
    success: "Saved successfully!",
    error: "Failed to save",
  }
);

✔ Auto loading ✔ Auto update ✔ Returns original promise


🔊 Audio Support

Audio Options

audio?: {
  enabled?: boolean;
  volume?: number; // 0–1
  audioFile?: string;
  cooldown?: number; // ms
};

Example

toast.success("Message sent", {
  audio: {
    enabled: true,
    volume: 0.8,
    audioFile: toast.sounds.success,
  },
});

✔ Per-toast control ✔ Cooldown prevents spam ✔ Custom sound support


🎨 Styling

Required

import "d9-toast/toast.css";

Tailwind Example

toast.success("Styled Toast", {
  className:
    "!bg-gradient-to-r from-indigo-600 to-purple-600 !text-white !rounded-xl",
});

⚠️ Use !important for Tailwind overrides


🧠 Advanced

Persistent Toast

const id = toast.info("Processing...", { duration: 0 });

// later
toast.dismiss(id);

JSX Content

toast.info(
  <div>
    <strong>Custom JSX</strong>
    <p>Supports React nodes</p>
  </div>
);

🧾 TypeScript Support

import type { ToastOptions, ToastType } from "d9-toast";

✔ Full IntelliSense ✔ Strict typing ✔ Zero any


📄 License

MIT © Athul / D9 Coder


❤️ Support My Work

👉 https://rzp.io/rzp/eVnJ0oP


🔗 Links


See CHANGELOG for details.