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-toast-native

v1.0.2

Published

Lightweight toast notifications for React. Zero dependencies, 4 types, fully customizable.

Readme

react-toast-native

npm MIT License GitHub Zero Dependencies React

Zero-dependency toast notifications for React. ~80 lines of source. No stylesheet. Fully auditable.

2 exports. No config needed. Fits in your head.


When to use this

Use react-toast-native when:

  • You're building a library or component and can't take on transitive dependencies
  • You want toast notifications small enough to read the entire source in 2 minutes
  • You need to dismiss a toast programmatically by ID (loading → success pattern)
  • You want zero CSS imports — fully inline-styled, no stylesheet conflicts

When react-hot-toast or react-toastify are the better choice: if you need promise-based toasts, toast.loading() patterns, rich custom components inside toasts, or you're building a large consumer app where bundle size is not a concern — use those. They're excellent and battle-tested.


Why not react-hot-toast?

react-hot-toast is great. If you're building a standard web app, use it.

react-toast-native exists for a different constraint: zero transitive dependencies and fully auditable source. When you're publishing a library yourself, or your project has strict dependency policies, pulling in react-hot-toast means pulling in its peer requirements and shipping code you didn't write. react-toast-native is ~80 lines — you can read every line before shipping it.


Features

  • success, error, info, warning types
  • Custom icons per toast
  • Top or bottom positioning
  • Auto-dismiss with configurable duration
  • Click to dismiss
  • Max visible toasts limit
  • Custom color schemes per type
  • Slide-in animation
  • Programmatic dismiss by ID
  • Zero dependencies — pure React + inline styles

Install

npm install react-toast-native

Usage

1. Wrap your app

import { ToastProvider } from 'react-toast-native'

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

2. Use anywhere

import { useToast } from 'react-toast-native'

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

  return (
    <button onClick={() => toast({ message: 'Saved!', type: 'success' })}>
      Save
    </button>
  )
}

Toast options

toast({
  message: 'Something went wrong',  // required
  type: 'error',                     // 'success' | 'error' | 'info' | 'warning'
  duration: 4000,                    // ms — 0 = persistent (default: 3000)
  icon: '🔥',                        // override default icon
})

ToastProvider props

| Prop | Type | Default | Description | |------|------|---------|-------------| | position | string | 'top' | 'top' or 'bottom' | | maxToasts | number | 3 | Max toasts visible at once | | colors | object | see below | Override colors per type |

Custom colors

<ToastProvider
  colors={{
    success: { bg: 'rgba(0,20,10,0.95)', border: 'rgba(0,200,100,0.3)', text: '#00c864' },
    error:   { bg: 'rgba(20,0,0,0.95)',  border: 'rgba(255,50,50,0.3)', text: '#ff3232' },
  }}
>

Dismiss programmatically

const { toast, dismiss } = useToast()

const id = toast({ message: 'Loading…', type: 'info', duration: 0 })
// later:
dismiss(id)

Used in Production

Built from the real implementation powering Sage and the full Rewrite Labs app suite.


Author

M. Adhitya — Founder, Rewrite Labs

License

MIT © 2025 M. Adhitya