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

@codaco/site-navigation-element

v1.0.2

Published

The canonical Network Canvas site header as a self-contained <nc-site-navigation> web component for non-React hosts

Readme

@codaco/site-navigation-element

The canonical Network Canvas site header, packaged as a self-contained <nc-site-navigation> web component for pages that aren't React apps (a Discourse forum, a static site, a CMS template, ...). It renders the same React SiteNavigation component the Network Canvas sites use, mounted inside a shadow root.

Usage

<script
  type="module"
  src="https://cdn.jsdelivr.net/npm/@codaco/site-navigation-element@1/dist/element.js"
></script>
<nc-site-navigation active-item="community" theme="dark"></nc-site-navigation>

The @1 pins to the major-version range, so hosts pick up nav changes automatically with no further action. A version range is incompatible with Subresource Integrity (a hash pins exact bytes and would break on every release); a host that wants that guarantee instead can point at an exact version and add its own integrity hash, trading auto-updates for a manual bump on every release.

You can also install it as a regular dependency and import the same bundle through your own bundler (import '@codaco/site-navigation-element') instead of loading it from a CDN.

Attributes

| Attribute | Values | Default | Notes | | ------------- | ---------------------------------------------------------------------------------------------------------- | ------- | ----------------------------------------------------- | | active-item | home | community | documentation | protocolGallery | resources | software | getStarted | unset | Highlights the matching link (aria-current="page"). | | locale | en-US | en-GB | es | en-US | Selects the nav's translated copy. | | theme | light | dark | auto | auto | auto follows the page's prefers-color-scheme. |

Attribute changes re-render the element live — updating theme or active-item after the element has connected takes effect immediately.

There's no utility slot (a place to render the account/theme switcher) in this version — hosts that want their own colour scheme reflected should set theme explicitly rather than relying on auto.

How it works / footprint

  • The whole thing ships as one self-contained ESM file — React, the compiled CSS, and everything else needed to render the header are inlined into dist/element.js (~194 kB gzipped / ~161 kB brotli over the wire).
  • Styles are isolated in a shadow root, so the header can't leak into or be affected by the host page's CSS.
  • Fonts and the @font-face/@property rules that can't apply inside a shadow root are injected once as a single document-level <style> tag. The woff2 font files themselves load from dist/fonts/, next to the bundle.
  • CSP caveat: a host with a strict style-src may block that injected document-level style tag. If it does, the header falls back to system fonts but stays otherwise styled — the shadow root's own styles are unaffected. The bundle URL also needs to be allowed by script-src.

Failure mode

If the script fails to load (network error, blocked by CSP, etc.), nothing renders. The element is purely additive chrome above the host's own page, so the rest of the page is unaffected either way.