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

react-modern-toastbox

v0.0.4

Published

[![npm version](https://img.shields.io/npm/v/react-modern-toaster)](https://www.npmjs.com/package/react-modern-toaster) [![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](https://opensource.org/licenses/MIT) [![Downloads](https://img.s

Readme

React Modern Toaster 🔔

npm version License: MIT Downloads

A lightweight, customizable, and TypeScript-ready toast notification system for modern React applications.

Toast Demo

✨ Features

  • 🚀 Lightweight & Fast: Zero external dependencies
  • 📱 Responsive: Works seamlessly on all screen sizes
  • 🎨 Customizable: Easy to style and adapt to your theme
  • 💪 TypeScript Support: Built with TypeScript for better development experience
  • 🔄 Auto Dismiss: Configurable auto-dismiss functionality
  • 🎯 Multiple Types: Success, Error, Warning, and Info toasts
  • ⚡ Easy Integration: Simple API with React Context

🔧 Installation

npm install react-modern-toaster
# or
yarn add react-modern-toaster
# or
pnpm add react-modern-toaster

🚀 Quick Start

  1. Wrap your app with the ToastProvider:
// main.jsx or main.tsx
import { ToastProvider } from 'react-modern-toaster'

function App() {
  return (
    <ToastProvider>
      <YourApp />
    </ToastProvider>
  )
}
  1. Add the ToastContainer to your app:
// App.jsx or App.tsx
import { ToastContainer } from 'react-modern-toaster'

function YourApp() {
  return (
    <>
      <YourComponents />
      <ToastContainer />
    </>
  )
}
  1. Use the useToast hook to show toasts:
import { useToast } from 'react-modern-toaster'

function MyComponent() {
  const { addToast } = useToast()

  const showSuccessToast = () => {
    addToast({
      message: 'Operation successful!',
      type: 'success',
      duration: 3000
    })
  }

  return (
    <button onClick={showSuccessToast}>
      Show Success Toast
    </button>
  )
}

📖 API Reference

ToastProvider

The context provider that should wrap your application.

<ToastProvider>
  <App />
</ToastProvider>

useToast Hook

const { addToast, removeToast, toasts } = useToast()

// Add a toast
addToast({
  message: string,
  type: 'success' | 'error' | 'warning' | 'info',
  duration?: number // in milliseconds, defaults to 3000
})

// Remove a specific toast
removeToast(id: string)

Toast Types

type ToastType = 'success' | 'error' | 'warning' | 'info'

interface ToastProps {
  id: string
  message: string
  type: ToastType
  duration?: number
}

🎨 Customization

The toasts can be customized using CSS classes. Each toast type has its own class for easy styling:

.toast-success {
  /* Custom styles for success toast */
}

.toast-error {
  /* Custom styles for error toast */
}

.toast-warning {
  /* Custom styles for warning toast */
}

.toast-info {
  /* Custom styles for info toast */
}

🌟 Examples

Different Toast Types

function ToastDemo() {
  const { addToast } = useToast()

  return (
    <div>
      <button onClick={() => addToast({ 
        message: 'Success!', 
        type: 'success' 
      })}>
        Success Toast
      </button>

      <button onClick={() => addToast({ 
        message: 'Error occurred!', 
        type: 'error' 
      })}>
        Error Toast
      </button>

      <button onClick={() => addToast({ 
        message: 'Warning!', 
        type: 'warning' 
      })}>
        Warning Toast
      </button>

      <button onClick={() => addToast({ 
        message: 'Info message', 
        type: 'info' 
      })}>
        Info Toast
      </button>
    </div>
  )
}

📝 License

MIT © Razal

🤝 Contributing

💖 Support

Give a ⭐️ if this project helped you!


Made with ❤️ by Razal