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

splashscreen-react

v1.0.1

Published

Frontend-only splash screen with real readiness detection and animated reveal for React applications.

Readme

splashscreen-react 🚀

A frontend-only splash screen for React applications that waits until the app is actually ready (DOM, fonts, images) and then smoothly reveals the UI with animations.

Built for modern React apps. No backend. No fake timeouts. No flicker.


✨ Features

  • ✅ Frontend-only readiness detection
  • ⏳ Waits for DOM, fonts, and images
  • 🎬 Smooth reveal animations
  • 🧩 Works with lazy routes & React Router
  • 🔒 Disables scroll during splash
  • ⚡ Lightweight & tree-shakable
  • 🧠 No content flash
  • 🧪 Tested with React 18+

📦 Installation

npm install splashscreen-react

or

yarn add splashscreen-react


🚀 Basic Usage

import { SplashScreen } from 'splashscreen-react';

function FullscreenLoader() {
    return (
        <div className="flex h-full w-full flex-col items-center justify-center text-white">
            <div className="h-10 w-10 animate-spin rounded-full border-4 border-white/20 border-t-white" />
            <span className="mt-3 text-sm">Loading…</span>
        </div>
    );
}

export default function App() {
    return (
        <SplashScreen loader={<FullscreenLoader />} minDuration={1200} waitForFonts waitForImages animation={{ type: 'scale-fade', duration: 700 }}>
            <YourApp />
        </SplashScreen>
    );
}

🎬 Animations

Built-in animations

  • fade
  • scale-fade
  • slide-up

Custom animation config

<SplashScreen animation={{ type: "scale-fade", duration: 800, easing: "ease-in-out" }}


⚙️ Props API

| Prop | Type | Default | Description | | ------------- | --------------- | --------------- | ------------------------ | | children | ReactNode | — | App or route content | | loader | ReactNode | Default spinner | Custom loader UI | | minDuration | number | 800 | Minimum splash time (ms) | | waitForFonts | boolean | true | Wait for fonts | | waitForImages | boolean | false | Wait for images | | animation | string / object | scale-fade | Reveal animation | | onReady | () => void | — | Called when splash ends |


🎨 Styling with CSS Variables

<SplashScreen style={{ "--ss-bg": "#0a0a0a", "--ss-duration": "700ms" }}

Available variables:

| Variable | Description | | ------------- | ----------------------- | | --ss-bg | Splash background color | | --ss-duration | Animation duration | | --ss-easing | Animation easing |


🧠 How It Works

  1. React mounts

  2. Splash screen appears

  3. Waits for:

    • DOM ready
    • Fonts (optional)
    • Images (optional)
    • Minimum duration
  4. Scroll is disabled

  5. App is revealed with animation

  6. Scroll is restored


4️⃣ Verify

npm view splashscreen-react

or visit:

https://www.npmjs.com/package/splashscreen-react


⚠️ Notes & Best Practices

  • React is a peerDependency
  • Splash runs only on initial mount
  • Works with Vite, CRA, and client-side Next.js
  • Avoid using h-screen inside loader

🛠 Troubleshooting

Loader never disappears

  • Ensure app mounts correctly
  • Check waitForImages on large images

Flash of content

  • Ensure splash wraps the correct component
  • Do not render content outside SplashScreen

Scroll issues

  • Splash automatically locks scroll
  • Avoid manual overflow overrides