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

genui-renderer-shadcn

v0.0.23

Published

UI component library with build-time registry generation for AI-powered UI composition

Readme

genui-renderer-shadcn

A React component library with AI-ready schemas for building dynamic UIs. Each component includes JSON Schema definitions and metadata, enabling LLMs to understand and generate valid component configurations.

Installation

npm install genui-renderer-shadcn

Features

  • 🎨 shadcn/ui styled components - Beautiful, accessible React components
  • 📋 JSON Schema definitions - Each component has a complete schema for validation
  • 🤖 AI-ready metadata - Rich descriptions for LLM decision-making
  • 📦 Build-time registry - Pre-generated component catalog as JSON
  • Zero runtime overhead - Registry is built at package publish time

Usage

Using Components

import { MetricsCard } from 'genui-renderer-shadcn';

function Dashboard() {
  return (
    <MetricsCard
      title="Q4 Sales"
      subtitle="Last updated 5 min ago"
      layout="grid"
      cols={3}
      metrics={[
        {
          label: "Revenue",
          value: "$125.4K",
          delta: 12.5,
          hint: "vs last quarter"
        },
        {
          label: "Customers",
          value: "3,421",
          delta: -2.3,
          hint: "30-day active"
        },
        {
          label: "Conversion",
          value: "18.2%",
          delta: 5.8
        }
      ]}
    />
  );
}

Using the Registry

The package includes a pre-built registry of all components with their schemas:

import registry from 'genui-renderer-shadcn/registry.json';

// Registry structure:
{
  "version": "1.0.0",
  "components": [
    {
      "id": "metrics_card",
      "name": "Metrics Card",
      "description": "A single card component that displays multiple KPI metrics...",
      "inputSchema": { /* JSON Schema */ },
      "capabilities": ["kpi", "numbers", "trend-delta"],
      "useCases": ["Business KPIs", "Sales dashboards", ...],
      "dataRequirements": { /* what data the component needs */ },
      "examples": [ /* example configurations */ ]
    }
  ],
  "hash": "sha256..."
}

Integration with AI Systems

Send the registry to your backend/LLM to enable dynamic UI generation:

// 1. Import the registry
import registry from 'genui-renderer-shadcn/registry.json';

// 2. Send to your AI backend
async function initializeAI() {
  await fetch('/api/ui-registry', {
    method: 'POST',
    headers: {
      'Content-Type': 'application/json',
      'X-Registry-Hash': registry.hash
    },
    body: JSON.stringify(registry)
  });
}

// 3. LLM can now generate valid component props
const aiResponse = await generateUI("Show sales metrics for Q4");
// Returns: { component: "metrics_card", props: { ... } }

// 4. Render dynamically
import { MetricsCard } from 'genui-renderer-shadcn';

function DynamicUI({ config }) {
  if (config.component === 'metrics_card') {
    return <MetricsCard {...config.props} />;
  }
}

Available Components

MetricsCard

Displays KPI metrics in a card format with optional trends and hints.

Props:

  • title?: Card title
  • subtitle?: Card subtitle
  • layout?: "grid" | "list" (default: "grid")
  • cols?: 2 | 3 | 4 (default: 3)
  • metrics: Array of metric objects:
    • label: Metric name (required)
    • value: Metric value (required)
    • delta?: Percentage change
    • hint?: Additional context
  • className?: Additional CSS classes

Use Cases:

  • Business KPIs and metrics
  • Sales performance dashboards
  • Analytics summaries
  • System performance stats

Component Discovery

Each component spec includes rich metadata for AI decision-making:

import { metricsCardSpec } from 'genui-renderer-shadcn';

console.log(metricsCardSpec);
// {
//   id: "metrics_card",
//   description: "A single card component that displays...",
//   capabilities: ["kpi", "numbers", "trend-delta", ...],
//   useCases: ["Business KPIs", "Sales dashboards", ...],
//   dataRequirements: {
//     required: ["Array of metrics"],
//     minMetrics: 1,
//     maxMetrics: 12
//   },
//   inputSchema: { /* JSON Schema */ }
// }

TypeScript Support

Full TypeScript support with exported types:

import type { MetricsCardProps, Metric } from 'genui-renderer-shadcn';

const metric: Metric = {
  label: "Revenue",
  value: "$100K",
  delta: 10.5,
  hint: "Monthly"
};

const props: MetricsCardProps = {
  title: "KPIs",
  metrics: [metric]
};

Schema Validation

Use the JSON schemas for runtime validation:

import Ajv from 'ajv';
import registry from 'genui-renderer-shadcn/registry.json';

const ajv = new Ajv();
const metricsSchema = registry.components.find(c => c.id === 'metrics_card').inputSchema;
const validate = ajv.compile(metricsSchema);

const valid = validate({
  metrics: [
    { label: "Revenue", value: "$100K" }
  ]
});

if (!valid) console.log(validate.errors);

Styling

Components use Tailwind CSS classes and expect these CSS variables:

:root {
  --background: 0 0% 100%;
  --foreground: 222.2 84% 4.9%;
  --muted: 210 40% 96.1%;
  --muted-foreground: 215.4 16.3% 46.9%;
  --border: 214.3 31.8% 91.4%;
  /* Add more as needed */
}

Components are designed to work with shadcn/ui themes.

License

MIT