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

popcrumb

v1.0.11

Published

A professional, lightweight, and **Universal** snackbar/toast library built for **React, Next.js, Expo, and React Native**. It supports rich content, manual dismissal, and deterministic IDs with a premium look and feel on all platforms.

Downloads

65

Readme

Popcrumb - Universal Snackbar & Toast Library

A professional, lightweight, and Universal snackbar/toast library built for React, Next.js, Expo, and React Native. It supports rich content, manual dismissal, and deterministic IDs with a premium look and feel on all platforms.

🚀 Overview

This library allows you to trigger snackbars from anywhere in your codebase—including outside of components—using a simple snackbar.success() style API. It automatically detects if it's running on the Web or Mobile and adapts its UI and logic accordingly.

🛠️ Installation

npm install popcrumb

📱 For Expo / React Native Users

You must also install react-native-svg to render the default icons:

npx expo install react-native-svg
# or
npm install react-native-svg

📖 Universal Usage

Popcrumb is designed to work with the same API across all platforms. However, the root integration differs slightly between Web and Mobile to handle the respective layout engines.

🌐 Web Integration (Next.js / React)

Add the components to your root layout or main App file:

// app/layout.js or App.js
import { SnackbarProvider, SnackbarManager, SnackbarContainer } from "popcrumb";

export default function RootLayout({ children }) {
  return (
    <SnackbarProvider>
      <SnackbarManager />
      {children}
      <SnackbarContainer />
    </SnackbarProvider>
  );
}

📱 Mobile Integration (Expo / React Native)

Ensure you have react-native-svg installed. Wrap your root component and place the container at the bottom of the stack.

// App.js
import { View } from "react-native";
import { SnackbarProvider, SnackbarManager, SnackbarContainer } from "popcrumb";

export default function App() {
  return (
    <SnackbarProvider>
      <SnackbarManager />
      {/* Container should be outside your main scroll/view for fixed positioning */}
      <View style={{ flex: 1 }}>
         {/* Your Navigation or Screens */}
      </View>
      <SnackbarContainer />
    </SnackbarProvider>
  );
}

📣 Triggering Alerts (Same for both!)

Once integrated, you can trigger alerts from anywhere (components, utility files, or even API middleware) using the same global API:

import { snackbar } from "popcrumb";

// Basic usage
snackbar.success("Action completed!");

// With options
snackbar.error("Connection lost", {
  duration: 3000,
  id: "connection-error"
});

Custom Icons / Images

You can customize the icon displayed in the snackbar by passing an icon property. This can be a string URL for an image, or a custom React component!

// Using an image URL (Works on Web & Mobile)
snackbar.success("Welcome back!", {
  icon: "https://avatars.githubusercontent.com/u/9919?s=64&v=4" 
});

// Using a custom React Node / SVG
snackbar.info("Processing...", {
  icon: <MyCustomSpinnerIcon />
});

Advanced: Manual Dismissal

// Show a specific toast
snackbar.error("Server is down", { id: "server-down" });

// Later, when fixed, dismiss it specifically by its ID
snackbar.dismiss("server-down");

Advanced: Functional Messages

You can pass a function as the message to access the id of the snackbar dynamically.

snackbar.info(
  ({ id }) => (
    <Box style={{ gap: 8 }}>
      <Typography>Please upgrade your plan.</Typography>
      <Button onPress={() => snackbar.dismiss(id)}>
        <Typography style={{ color: '#3b82f6' }}>Upgrade Now</Typography>
      </Button>
    </Box>
  ),
  { id: "upgrade-notice" },
);

🎨 Features

  • Cross-Platform: Works on Web (Next.js/React) and Mobile (Expo/React Native).
  • Global API: No hooks required to trigger alerts.
  • Auto-Styling: Premium design using inline styles (no CSS/Tailwind required).
  • Customizable: Pass custom React components or images as icons.
  • Lightweight: Zero-dependency for web (except React).

📝 API Reference

The snackbar object provides the following methods:

Core Methods

| Method | Description | |--------|-------------| | snackbar.success(message, options?) | Shows a success snackbar. | | snackbar.error(message, options?) | Shows an error snackbar. | | snackbar.warning(message, options?) | Shows a warning snackbar. | | snackbar.info(message, options?) | Shows an info snackbar. | | snackbar.dismiss(id) | Dismisses a specific snackbar by its ID. |

Options Object

| Property | Type | Default | Description | |----------|------|---------|-------------| | duration | number | 4000 | Auto-dismiss duration in milliseconds. Use Infinity for manual dismissal only. | | id | string | (Auto-generated) | Unique identifier for the snackbar. | | icon | ReactNode or string | (Variant default) | Custom icon to display. | | onOpen | () => void | undefined | Callback when snackbar opens. | | onClose | () => void | undefined | Callback when snackbar closes. |

Example

import { snackbar } from "popcrumb";

// Show with custom duration and ID
snackbar.info("Processing...", {
  duration: 6000,
  id: "process-1"
});