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-network-notifier

v2.0.3

Published

A fun and witty React component that displays humorous messages and images when the internet connection is lost, keeping your users entertained while they wait for the connection to return.

Downloads

567

Readme

React Network Notifier

A highly optimized, zero-dependency React component that elegantly handles internet connection drops. It seamlessly displays witty offline messages and engaging visuals to keep your users entertained while they wait for their connection to return.

Supports both React and Next.js applications, fully compatible with Server-Side Rendering (SSR).

NPM Version NPM Downloads Bundle Size React Support Next.js License

react-network-notifier

Why We Built This

At Code Media Labs, we build applications that demand constant uptime and perfect user experiences. However, internet connectivity is often out of a developer's control. Rather than letting applications silently fail or freeze when users lose their connection, we built react-network-notifier to fail gracefully.

Instead of frustration, users are met with beautifully animated, witty "offline" states that improve retention and user satisfaction until their network returns. We open-sourced this to help teams everywhere implement enterprise-grade offline UX with zero boilerplate.

What's New in v2.0.0

Version 2.0.0 was a complete rewrite from the ground up, built for modern React architectures.

  • Microbundle to Tsup: Replaced the entire build system, aggressively minifying the bundle to under 5KB.
  • Multiple Variants: Added configurable toast, banner, and fullscreen notification styles.
  • Native CSS Modules: Extracted expensive React inline style objects into highly performant injected CSS modules.
  • Dark Mode Support: Component now natively respects system dark mode preferences seamlessly.
  • Reconnect Handling: Added automatic, customizable success messages ("Hooray, we're back online") when connection is restored before smoothly sliding away.
  • SVG / Icon Support: Support for both retro ASCII art and modern SVG icons.

Installation

npm install react-network-notifier
#or
yarn add react-network-notifier

Usage

Import the NetworkNotifier component and add it to your root layout:

import NetworkNotifier from "react-network-notifier";

function App() {
  return (
    <div>
      <NetworkNotifier />
      {/* Your app components */}
    </div>
  );
}

export default App;

Custom Configuration (v2.0+)

The component is heavily modular. You can pass custom messages, custom reconnect states, specific SVG / ASCII configurations, variants (toast | banner | fullscreen), and dark mode preferences (light | dark | system).

import NetworkNotifier from "react-network-notifier";

const customMessages = [
  "It looks like your router took a coffee break.",
  "Offline mode activated. Time to stretch your legs!",
];

const customReconnectMessages = [
  "We are back online! Commencing data sync.",
  "Connection restored. Welcome back to the grid.",
];

function App() {
  return (
    <div>
      <NetworkNotifier
        messages={customMessages}
        reconnectMessages={customReconnectMessages}
        variant="toast"
        theme="system"
        iconType="svg"
        closable={true}
      />
      {/* Your app components */}
    </div>
  );
}

export default App;

Configuration Props

| Prop | Type | Default | Description | | :------------------ | :------------------------------------ | :------------- | :------------------------------------------------------------ | | messages | string[] | [] | Array of strings displayed when the connection is lost. | | reconnectMessages | string[] | [] | Array of strings displayed when the connection is restored. | | images | string[] | [] | Array of ASCII art strings shown during offline states. | | styles | React.CSSProperties | {} | Inline styles to override or extend default component CSS. | | variant | "toast" \| "banner" \| "fullscreen" | "fullscreen" | Determines the visual layout and positioning. | | iconType | "ascii" \| "svg" | "ascii" | Toggle between retro ASCII graphics or modern SVG icons. | | theme | "light" \| "dark" \| "system" | "system" | Sets the UI color mode (Light, Dark, or Browser preference). | | closable | boolean | true | If true, allows users to manually dismiss the notification. |

Contributing

Contributions, issues, and feature requests are welcome! Feel free to check the issues page.

License

MIT License. See LICENSE for more information.

Work with Us

This project is maintained by Code Media Labs. We are an agency focused on building enterprise-grade, highly scalable software solutions.

If you like our work and are looking for a reliable technical partner for your next project, feel free to reach out to us: