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

@usesource/adapter-shadcn

v0.1.0

Published

shadcn/ui ↔ canonical SOURCE mapping pack. Maps shadcn component names and CSS variable tokens to source.* canonical IDs so cross-library translate tools (in @usesource/mcp / @usesource/scan) can pivot through SOURCE without library-specific mapping code.

Downloads

49

Readme

@usesource/adapter-shadcn

shadcn/ui ↔ canonical SOURCE mapping pack. Maps shadcn component names and CSS variable tokens to source.* canonical IDs so cross-library translate tools (in @usesource/mcp and @usesource/scan) can pivot through SOURCE without library-specific mapping code.

Install

npm install @usesource/adapter-shadcn

Use

import {
  lookupByIdentifier,
  lookupByCanonical,
  listMappings,
  ADAPTER_INFO,
} from "@usesource/adapter-shadcn";

// shadcn → canonical
const buttonMapping = lookupByIdentifier("Button", "component");
// → { canonical: "source.element.button", confidence: 1, ... }

const primaryToken = lookupByIdentifier("primary", "token");
// → { canonical: "source.core.color.primary.500", confidence: 0.85, ... }

// canonical → shadcn (reverse)
const matches = lookupByCanonical("source.element.button");
// → [{ identifier: "Button", confidence: 1, ... }]

// Bulk listing for codegen / inspection
for (const m of listMappings()) console.log(m.identifier, "→", m.canonical);

console.log(ADAPTER_INFO);
// → { library: "shadcn", version: "0.1.0", mappingCount: 46 }

What's mapped (v0.1.0)

| Type | Count | Examples | |---|---:|---| | component | 29 | Button, Card, Dialog, Input, Tabs, Sheet, … | | token | 17 | primary, background, foreground, muted, ring, radius, … |

shadcn's tokens are the CSS variables exposed in globals.css (--primary, --background, --radius, etc.). Components are the exported React components from @/components/ui/*.

What's NOT mapped (yet)

  • Variant props (variant="destructive", size="lg"). These are configuration on top of the canonical component, not separate identifiers. Codemods that translate variants will rely on a separate variant-mapping pack — out of scope for this adapter pack.
  • Tailwind utility classes used inside shadcn components. Those are Tailwind-native and would map through a @usesource/adapter-tailwind pack (planned).
  • Component composition patterns (e.g. <Card><CardHeader>...). The adapter maps the top-level component identifier; sub-component composition is a translator concern, not an adapter concern.

Stability

  • Adapter version is independent of @usesource/registry snapshot version.
  • The contract is stable: lookupByIdentifier, lookupByCanonical, and listMappings will not change signature without a major bump.
  • All mappings validate against LibraryMappingSchema from @usesource/schema on import. A bad mapping throws — refusing to serve incorrect translations is preferable to silently serving them.

License

Apache-2.0. See LICENSE at the repository root.