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

@vctqs1/nav-progress-bar-react

v0.3.0

Published

Lightweight navigation progress bar for React and Next.js App Router with zero dependencies

Downloads

1,012

Readme

@vctqs1/nav-progress-bar-react

React wrapper for @vctqs1/nav-progress-bar. It renders the <vctqs1-nav-progress-bar> custom element, re-exports the core API, and adds JSX typing so React and Next.js App Router can use it without extra setup.

Live demo: https://nav-progress-bar.vercel.app/

Demo video:

Installation

pnpm add @vctqs1/nav-progress-bar-react

Quick Start

Next.js App Router

Use this wrapper when you want a React component in app/layout.tsx. The core package still wires browser navigation events in normal browser setups, but App Router should call start() from its own transition hook.

// app/layout.tsx
import NavProgressBar from '@vctqs1/nav-progress-bar-react';

export default function RootLayout({ children }: { children: React.ReactNode }) {
  return (
    <html>
      <body>
        <NavProgressBar primary="#3fffa8" />
        {children}
      </body>
    </html>
  );
}
// instrumentation-client.ts
import { getNavProgressBar, registerNavProgressBar } from '@vctqs1/nav-progress-bar-react';

registerNavProgressBar();

export function onRouterTransitionStart() {
  getNavProgressBar()?.start();
}

In the demo app, product routes intentionally delay their server response so you can see the progress bar appear before the route-level loading.tsx fallback.

React SPA

In a normal React app, register once and render the wrapper. The core package wires the Navigation API listeners itself in supported browsers.

import NavProgressBar, { registerNavProgressBar } from '@vctqs1/nav-progress-bar-react';

registerNavProgressBar();

export default function App() {
  return (
    <>
      <NavProgressBar />
      <main>{/* routes */}</main>
    </>
  );
}

Why This Package Exists

The core package is framework-agnostic. This wrapper exists to make React usage feel native:

  1. It renders the custom element from JSX.
  2. It ships JSX types so TypeScript accepts <vctqs1-nav-progress-bar>.
  3. It keeps SSR-friendly declarative shadow DOM support available without forcing React into the core package.

Props

| Prop | Type | Default | Description | |---|---|---|---| | primary | string | #006bde | Bar color. Accepts a hex color or a CSS custom property name like --brand-color. | | height | string | 3px | Bar height. Accepts a CSS length or a CSS custom property name like --nav-bar-height. |

loading.tsx vs NavProgressBar

loading.tsx only appears after the server responds. The progress bar can start earlier, but in Next.js App Router that start signal should come from your own transition hook, not from the browser navigate event alone.

// app/products/[id]/loading.tsx
export default function Loading() {
  return <p>Loading product…</p>;
}

That is why the demo uses a delayed product route: the bar should show first, then the loading skeleton should take over, then the page content should render.

SSR

The wrapper renders the custom element server-side, and the underlying component reuses declarative shadow DOM during hydration. That avoids the flash you would get from mounting an empty custom element and filling it later in the browser.

Related

License

MIT