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

v1.0.1

Published

Easily put your React app into maintenance mode with customizable layouts, countdown timers, IP whitelisting, and scheduled downtime — all with a plug-and-play component. A flexible and fully customizable React component for maintenance mode. Easily contr

Readme

🚧 React Maintenance

A lightweight and fully customizable React component to gracefully handle maintenance mode in your application. Easily restrict access by IP, schedule maintenance windows, show countdowns, and display custom messages or components.

🚀 Features

  • Simple and easy to use
  • Fully customizable message and styles
  • Responsive design for all devices
  • Quick setup with minimal configuration

📦 Installation

Install the package using npm or yarn:

npm install react-maintenance

or

yarn add react-maintenance

📌 Usage/Examples

Import and use the Maintenance component in your React application:

// Import the Maintenance component
import React from 'react';
import { Maintenance } from 'react-maintenance';

const App = () => {
  // Configuration for Maintenance mode
  const maintenanceConfig = {
    CustomComponent: <div>Maintenance mode on</div>, // Optional: Customize the message displayed during maintenance mode.
    allowedIPs: ['192.156.2.564', '651.25.1.54'], // Optional: List of IPs allowed to bypass maintenance mode.
  };

  return (
    <>
      {/* Wrap your application inside the Maintenance component */}
      <Maintenance {...maintenanceConfig}>
        {/* Content displayed when maintenance mode is off */}
        <div>Hello World</div>
      </Maintenance>
    </>
  );
};

export default App;

🛠 Props

The Maintenance component accepts the following props:

| Prop | Type | Default Value | Description | | ----------------- | ----------- | ----------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------- | | children | ReactNode | null | The content to render when the application is not in maintenance mode or the IP is allowed. | | CustomComponent | ReactNode | null | A custom React component to display during maintenance mode. | | allowedIPs | string[] | [] | Array of IP addresses allowed to bypass maintenance mode. | | startTime | string | null | Start time of the maintenance window (ISO string format). | | endTime | string | null | End time of the maintenance window (ISO string format). | | showCountdown | boolean | false | Shows a live countdown timer until the end of the maintenance window. | | title | string | "We'll be back soon!" | Title text shown during maintenance. | | message | string | "Sorry for the inconvenience. We're performing some scheduled maintenance." | Message text shown during maintenance. | | customStyles | object | {} | Custom style overrides. Supports keys: page, container, title, message. Example below. |

🧩 Example customStyles object

customStyles={{
  page: { padding: '2rem' },
  container: { borderRadius: '8px' },
  title: { fontSize: '2.5rem' },
  message: { fontSize: '1.2rem' }
}}

🌐 IP Whitelisting

You can allow specific IP addresses to bypass maintenance mode using the allowedIPs prop. IP is fetched via https://ipinfo.io/json.

📅 Time-Based Maintenance

Pass startTime and endTime as ISO strings to enable maintenance mode only during a specific window.

⏳ Countdown Timer

Set showCountdown={true} to show a live countdown until the end of the maintenance window.

🧪 Environment Support

Maintenance mode is only active when REACT_APP_PRODUCTION=true is set in your environment. This ensures it doesn't affect development builds.

📝 License

MIT – Feel free to use and contribute!

🙋‍♂️ Author Details

portfolio linkedin

📞 Support

For any issues or feature requests, feel free to open an issue or reach out via email.