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

@kojodesign/shadcn-tools

v1.1.0

Published

<div align="center"> <img src="logo.svg" width="48px" alt="shadcn logo" />

Readme

shadcn-tools

Type-safe helpers and a CLI for building shadcn registries.

Install

bun add @kojodesign/shadcn
yarn add @kojodesign/shadcn
npm install @kojodesign/shadcn
pnpm install @kojodesign/shadcn

Peer dependencies: shadcn >= 4, typescript >= 5

Usage

Define registry items

Create sidecar .registry.ts files next to your components:

// src/components/ui/button.registry.ts
import { schema } from "@kojodesign/shadcn-tools";

export default schema.ui({
  name: "button",
  files: [schema.files.ui("@/components/ui/button.tsx")],
  dependencies: ["lucide-react"],
  registryDependencies: ["$utils"],
});

Item helpers

| Helper | Registry type | | ----------------------- | -------------------- | | schema.ui(...) | registry:ui | | schema.block(...) | registry:block | | schema.hook(...) | registry:hook | | schema.lib(...) | registry:lib | | schema.component(...) | registry:component | | schema.style(...) | registry:style | | schema.theme(...) | registry:theme | | schema.font(...) | registry:font | | schema.base(...) | registry:base | | schema.page(...) | registry:page | | schema.file(...) | registry:file | | schema.item(...) | registry:item |

File helpers

| Helper | Use for | | ------------------------------------- | ----------------------- | | schema.files.component(path) | Component files | | schema.files.ui(path) | UI component files | | schema.files.block(path) | Block files | | schema.files.hook(path) | Hook files | | schema.files.lib(path) | Lib/utility files | | schema.files.page(path, { target }) | Route/page files | | schema.files.file(path, { target }) | Misc files (env/config) |

@/ paths are resolved to src/ automatically.

Aggregate into a registry

// registry.ts
import { schema } from "@kojodesign/shadcn-tools;
import button from "./src/components/ui/button.registry.ts";
import utils from "./src/lib/utils.registry.ts";

export default schema.registry({
  name: "my-registry",
  homepage: "https://my-registry.example.com",
  items: [button, utils],
});

Registry dependencies

  • $name — references another item in the same registry. Resolved to ${homepage}/r/name.json at build time.

  • @registry/name — cross-registry reference. Resolved via the registries map:

    schema.registry({
      name: "my-registry",
      homepage: "https://mine.example.com",
      registries: { other: "https://other.example.com" },
      items: [
        schema.ui({
          name: "fancy-button",
          files: [schema.files.ui("@/components/ui/fancy-button.tsx")],
          registryDependencies: ["$utils", "@other/card"],
        }),
      ],
    });
  • Bare names (e.g. "button") — upstream shadcn components, passed through as-is.

CLI

build-registry <path/to/registry.(ts|js)> [-o <output-dir>]
  1. Loads the registry file via jiti (TypeScript and plain JavaScript both supported; tsconfig paths are respected when present)
  2. Writes registry.json next to the input file
  3. If -o is provided, runs shadcn build to produce individual item JSON files
# TypeScript
build-registry registry.ts

# Plain JavaScript (ESM)
build-registry registry.js

# Generate registry.json + per-item files in public/r/
build-registry registry.ts -o public/r

Agent Skills

This package includes an update-registry skill for Claude Code that audits .registry.ts files — checking dependencies, registry dependencies, file arrays, style/CSS sync, and missing sidecar files. Install it into any project that uses `@kojodesign/shadcn-tools:

npx skills add @kojodesign/shadcn-tools

Then use it in Claude Code with /update-registry or by asking Claude to audit your registry files.

License

MIT