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

v1.3.0

Published

A production-ready toast notification system for React Native.

Readme

react-native-toast-system

Host-aware toasts for React Native apps with screens, modals, and bottom sheets.

  • Route toasts to the right UI surface with global and host-scoped APIs.
  • Ship faster with Expo-ready setup that stays stable through gestures, keyboard shifts, and nested navigation.
  • Handle real app feedback flows with built-in dedupe/grouping and promise-based toasts.

Platform support (current): iOS and Android only. Web is not officially supported yet.

When should I use this?

Use this if

  • You need to trigger toasts from both app-wide actions and local surfaces.
  • Your app uses modals, bottom sheets, or nested navigation stacks.
  • You want a typed toast API without building host routing yourself.

Do not use this if

  • You only need a single root-level banner with no surface-specific behavior.
  • Your app is web-only today.
  • You want a full notification center instead of lightweight toast feedback.

10-second quick example

import { toast, useToast } from "react-native-toast-system";

// Global usage
toast.success("Saved successfully");

// Host usage (for example inside a modal)
const modalToast = useToast("modal");
modalToast.error("Something went wrong");

Why this exists

Most toast libraries assume one root host. Real apps do not.

  • Modals often need their own surface so feedback is visible where the user is acting.
  • Bottom sheets can clip, overlap, or hide global toasts.
  • Nested navigation can make root-only toast placement feel disconnected from the active UI.

Live Expo Demo

Scan the QR to open the in-repo example update.

exp://u.expo.dev/3809a530-4f74-45b2-bb25-7a8a6e8672f4/group/5e489388-b5dc-43b6-b459-3a579239adc3

45-second demo flow

One scenario, six behaviors: root toast, modal toast, bottom-sheet toast, dedupe, promise lifecycle, and keyboard-safe bottom placement.

Caption: Root success, modal error, sheet warning, deduped retries, promise loading-to-success, and keyboard-aware bottom toast in one continuous flow.

AI and Agent References

Quick Links

📦 Installation

pnpm add react-native-toast-system

Peer dependencies (install if your app does not already have them):

pnpm add react-native-gesture-handler react-native-reanimated react-native-safe-area-context react-native-svg react-native-worklets
pnpm add react-native-screens

react-native-screens is optional and mainly needed for RN Screens overlay scenarios.

✅ Runtime Setup Checklist

  1. Enable Reanimated Babel plugin.
  2. Wrap app root with GestureHandlerRootView.
  3. Wrap app root with SafeAreaProvider.
  4. Mount ToastProvider above all toast callers.
  5. Mount at least one host (ToastViewport or ToastHost).
  6. For native surfaces (for example React Native Modal), wrap with ToastNativeSurfaceBoundary when gesture activation needs a dedicated root.

⚡ Quick Start

Quick start examples target native apps (iOS/Android).

import React from "react";
import { Button, View } from "react-native";
import { ToastProvider, ToastViewport, toast, useToast } from "react-native-toast-system";

function DemoScreen() {
  const localToast = useToast();

  return (
    <View>
      <Button
        title="Global toast"
        onPress={() => toast.success({ title: "Saved", description: "Changes persisted." })}
      />
      <Button
        title="Hook toast"
        onPress={() => localToast.show({ title: "Welcome", description: "Hello from useToast()." })}
      />
    </View>
  );
}

export function App() {
  return (
    <ToastProvider>
      <DemoScreen />
      <ToastViewport />
    </ToastProvider>
  );
}

🧩 API Surface At A Glance

  • ToastProvider: owns store/runtime and binds global API
  • ToastViewport / ToastHost: renders host stacks
  • toast: global controller facade
  • useToast(hostId?): host-scoped controller hook
  • createToastSystem(...): typed system helper for templates

Import Paths

Root import remains fully supported:

import { ToastProvider, ToastViewport, toast, useToast } from "react-native-toast-system";

Optional subpath imports are also available:

import { ToastProvider } from "react-native-toast-system/providers";
import { ToastHost, ToastViewport } from "react-native-toast-system/components";
import { useToast } from "react-native-toast-system/hooks";
import { toast } from "react-native-toast-system/utils";

🧪 Expo Playground (In-Repo)

From repository root:

pnpm run example:install
pnpm run example:start
pnpm run example:validate

Optional targets:

pnpm run example:android
pnpm run example:ios
pnpm run example:web

🛠️ Development Commands

pnpm install
pnpm run lint
pnpm run test
pnpm run build
pnpm run pack:dry-run

Docs commands:

pnpm run docs:install
pnpm run docs:start
pnpm run docs:build
pnpm run docs:serve
pnpm run docs:version -- --help

Release readiness checks:

pnpm run validate:release

🧱 Compatibility

  • Node: >=18
  • React Native: see peerDependencies in package.json
  • Expo: validated via the in-repo example/ app

🔍 Validation Philosophy

This project separates automated and manual confidence:

  • Automated: lint, typecheck, tests, build, pack dry-run, example validation, docs validation
  • Manual: modal/sheet parity, gesture interactions, keyboard overlap, navigation persistence, and full RTL behavior validation after app restart

🏛️ Governance

📄 License

MIT