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

gad-visual-context

v0.1.2

Published

Visual Context System (VCS) — deterministic component IDs, dev-mode inspector modal, and source-searchable visual identities for any React app. Ships from the GAD framework.

Readme

gad-visual-context

Visual Context System (VCS) for React — deterministic component IDs, a dev-mode inspector modal, and source-searchable visual identities for any React application. Ships from the GAD framework.

VCS assigns every rendered UI region a stable cid (component ID) that survives reloads. In dev mode, hovering any wrapped region and pressing Alt+I opens an inspector panel showing the component tree, cids, and one-click AI-agent prompt templates for that surface.

Installation

npm install gad-visual-context

@portfolio/ui is a required peer dependency (shadcn-based component library). If you are consuming this inside the GAD monorepo it is already workspace-linked.

Peer dependencies

{
  "react": ">=19.0.0",
  "react-dom": ">=19.0.0",
  "@portfolio/ui": "workspace:*"
}

Usage — Next.js app/layout.tsx

// app/layout.tsx
import { VisualContextProvider, DevIdProvider } from "gad-visual-context";
import { useMemo } from "react";

export default function RootLayout({ children }: { children: React.ReactNode }) {
  return (
    <html lang="en">
      <body>
        <VisualContextProvider>
          <DevIdProvider enabled={process.env.NODE_ENV === "development"}>
            {children}
          </DevIdProvider>
        </VisualContextProvider>
      </body>
    </html>
  );
}

For Next.js with router adapter (recommended — enables pathname-aware cid labels):

// components/AppVisualContextProvider.tsx
"use client";
import { useMemo } from "react";
import { usePathname, useRouter } from "next/navigation";
import {
  VisualContextProvider,
  type VCSRouterAdapterValue,
} from "gad-visual-context";

export function AppVisualContextProvider({ children }: { children: React.ReactNode }) {
  const pathname = usePathname() ?? "/";
  const nextRouter = useRouter();
  const adapter = useMemo<VCSRouterAdapterValue>(
    () => ({
      pathname,
      router: {
        push: (href) => nextRouter.push(href),
        replace: (href) => nextRouter.replace(href),
        back: () => nextRouter.back(),
        forward: () => nextRouter.forward(),
        refresh: () => nextRouter.refresh(),
        prefetch: (href) => nextRouter.prefetch(href),
      },
    }),
    [pathname, nextRouter],
  );
  return <VisualContextProvider router={adapter}>{children}</VisualContextProvider>;
}

Wrap UI regions with SiteSection:

import { SiteSection } from "gad-visual-context";

export function HeroSection() {
  return (
    <SiteSection cid="hero.main">
      <h1>Hello</h1>
    </SiteSection>
  );
}

Exports

| Export | Description | |---|---| | VisualContextProvider | Root provider — mounts the VCS context and optional router adapter | | DevIdProvider | Dev-mode overlay provider — enables cid inspector (pass enabled={false} in production) | | DevPanel | Floating inspector panel (auto-mounted inside DevIdProvider) | | BandDevPanel | Band-scoped variant of DevPanel for section-level inspection | | SiteSection | Wraps any region with a cid — renders as a transparent div | | Identified | Wraps any element and registers a cid without layout impact | | IdentifiedPrimitive | Lower-level primitive for non-div elements | | CrudModalFooter | Standard CRUD modal footer with VCS-aware action buttons | | SiteProse | Prose content wrapper with cid support | | SiteSectionHeading | Heading component wired to SiteSection | | DevIdSearchDialog | Fuzzy-search dialog across all registered cids | | DevIdAgentPromptDialog | AI-agent prompt builder for a selected cid | | DevIdModalContextFooter | Footer component for DevId modal surfaces | | KeyboardShortcutsProvider | Mounts the ? keyboard shortcut cheatsheet overlay | | useVisualContext | Hook — access current VCS context value | | useDevId | Hook — access DevId state (selected cid, enabled flag) | | useDevIdEnabled | Hook — boolean, true when DevId overlay is active |

Dev modal keybinding

| Key | Action | |---|---| | Alt+I | Toggle DevId inspector panel | | Alt+K | Open cid search dialog | | Alt+click | Select a cid by clicking its region | | ? | Open keyboard shortcut reference | | Escape | Close active panel |

Links