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

@schemastud/nav

v0.1.0

Published

A host-agnostic suite of navigation primitives for content/doc sites (a deliberate umbrella, meant to grow: pager/top-nav/tabs later). Today: a compose-many nav-source registry, a pure tree builder (group + one-level nest + order), a collapsible <Expandab

Readme

@schemastud/nav

A host-agnostic suite of navigation primitives for content/doc sites. A deliberate umbrella: the pieces below share a model (and a house style — no CSS, no router; the host injects link rendering, class names, and the current path), and the package is meant to grow more nav primitives over time (a prev/next pager, a top nav, tabs, a mobile drawer) rather than fragment into a package each. Components are named for the specific thing they are — ExpandableNav, OnThisPage, … — so the umbrella never hides what you're importing, and tree-shaking keeps a consumer paying only for what it uses.

Members

  • Nav-source registry (compose-many). registerNavSource({ id, order?, load }) — any package contributes nav data via a lazy load() returning typed NavNodes. All registered sources concatenate; registration is additive.
  • Pure tree builder. buildNavTree(nodes, trackOrder?) groups by group, nests one level by parent leaf slug, and sorts (groupOrder across groups, order within). The NavNode model is track → group → item — a hierarchical list/side-nav shape.
  • <ExpandableNav>. A collapsible sidebar over the seam: <button aria-expanded> group disclosures, the active guide's group open on load, localStorage persistence, initialGroupState: 'expanded' | 'collapsed', and injected classes + renderLink. The only inline styles are the grid-rows collapse animation + chevron rotation, both suppressed under prefers-reduced-motion.
  • navTrail(tree, href). The breadcrumb trail (track → group → page) derived from the same tree, with sibling lists for searchable switcher crumbs. Pairs with — does not replace — @schemastud/breadcrumb (this derives the data; that renders the trail).
  • <OnThisPage>. An automatic in-page table of contents: reads id-bearing headings from the rendered DOM, builds #anchor links, and drives an IntersectionObserver scroll-spy. Injected classes, heading selector/container, and a routeKey that re-scans on navigation.

The same composed tree feeds both the sidebar and the breadcrumb, so they never disagree.

Scope

In: navigation structure for a content site — the list/tree/side nav, its data model, the in-page TOC, the breadcrumb-trail derivation, and future nav primitives (pager, top nav, tabs). Out: standalone UI atoms that already have a home — breadcrumb rendering (@schemastud/breadcrumb), the searchable dropdown (@schemastud/combobox). This package composes those; it doesn't re-implement them.