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-microtoast

v1.0.0

Published

A lightweight React toast library with progress bar, auto dark mode, and per-toast position control πŸ””

Readme

react-microtoast

A lightweight React toast library with progress bar, auto dark mode, and per-toast position control. Micro in size, mighty in features.

npm version license


Why react-microtoast?

Other toast libraries make you choose β€” either you get a progress bar, or auto dark mode, or per-toast positions. With react-microtoast you get all three, with a 2-line setup and zero extra config.

| Feature | react-toastify | react-hot-toast | sonner | react-microtoast | |---|---|---|---|---| | Progress bar | βœ… | ❌ | ❌ | βœ… | | Auto dark mode | Manual | Manual | βœ… | βœ… | | Per-toast position | ❌ | ❌ | ❌ | βœ… | | Bundle size | ~50kb | Light | Light | Micro | | Setup | Medium | Easy | Easy | Easiest |


Features

  • 4 toast types β€” success βœ…, error ❌, warning ⚠️, info ℹ️
  • Progress bar showing time remaining
  • Stack multiple toasts without overlap
  • Per-toast position control β€” each toast can appear in a different corner
  • Auto dismiss with configurable duration
  • Manual close button
  • Auto light & dark mode β€” no setup needed
  • Zero dependencies (only React as peer dep)
  • Micro bundle size

Installation

npm install react-microtoast

Setup

Just 2 lines β€” wrap your app with ToastProvider and drop in ToastContainer:

import { ToastProvider, ToastContainer } from 'react-microtoast'

function App() {
  return (
    <ToastProvider position="top-right" duration={3500}>
      <ToastContainer />
      <YourApp />
    </ToastProvider>
  )
}

Usage

Use the useToast hook anywhere inside your app:

import { useToast } from 'react-microtoast'

function MyComponent() {
  const toast = useToast()

  return (
    <div>
      <button onClick={() => toast.success('Profile saved!')}>Save</button>
      <button onClick={() => toast.error('Something went wrong!')}>Delete</button>
      <button onClick={() => toast.warning('Please review before continuing.')}>Submit</button>
      <button onClick={() => toast.info('New update available.')}>Info</button>
    </div>
  )
}

Per-toast Options

Override position and duration individually per toast:

toast.success('Done!', { position: 'bottom-left' })
toast.error('Failed!', { duration: 8000 })
toast.info('Heads up!', { duration: 5000, position: 'top-left' })

ToastProvider Props

| Prop | Type | Default | Description | |------|------|---------|-------------| | position | string | "top-right" | Default position for all toasts | | duration | number | 3500 | Auto dismiss time in milliseconds |

Position options: top-right top-left bottom-right bottom-left


Toast Methods

| Method | Description | |--------|-------------| | toast.success(message, options?) | Green success toast | | toast.error(message, options?) | Red error toast | | toast.warning(message, options?) | Amber warning toast | | toast.info(message, options?) | Blue info toast |


Dark Mode

Fully automatic β€” uses prefers-color-scheme under the hood. No class toggling, no extra props, no setup.


Project Structure

react-microtoast/
β”œβ”€β”€ src/
β”‚   β”œβ”€β”€ components/
β”‚   β”‚   β”œβ”€β”€ Toast.jsx
β”‚   β”‚   └── ToastContainer.jsx
β”‚   β”œβ”€β”€ context/
β”‚   β”‚   └── ToastContext.jsx
β”‚   β”œβ”€β”€ hooks/
β”‚   β”‚   └── useToast.js
β”‚   β”œβ”€β”€ styles/
β”‚   β”‚   └── toast.css
β”‚   └── index.js
β”œβ”€β”€ package.json
└── README.md

License

MIT β€” free to use in any project.


Made for devs who just want toasts to work. Micro in size, mighty in features.