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 🙏

© 2025 – Pkg Stats / Ryan Hefner

@hetenho/showcase

v0.5.0

Published

A Storybook-like component manager that renders components from multiple frameworks (React, Vue, Solid, Angular, Lit) inside Shadow DOM for complete style isolation.

Readme

Showcase

A Storybook-like component manager that renders components from multiple frameworks (React, Vue, Solid, Angular, Lit) inside Shadow DOM for complete style isolation.

Features

  • 🎨 Multi-Framework Support: Develop and showcase components from React, Vue, Solid, Angular, and Lit in one repository
  • 🔒 Shadow DOM Isolation: Each component renders in its own Shadow DOM, ensuring complete style isolation
  • 🧭 Auto-Discovery: Automatically finds components based on folder structure (src/components/react/, src/components/vue/, etc.)
  • 🎛️ Interactive Props Panel: Edit component props in real-time with schema extraction from TypeScript types
  • 🧪 Visual Snapshot Testing: Vitest + Playwright integration for visual regression testing
  • ⚙️ Framework Switcher: Download updated package.json files when switching between frameworks
  • 📦 Presets: Built-in support for Shadcn UI and Base UI component patterns

Quick Start

Installation

npm install

Development

npm run dev

The app will start at http://localhost:5173 with your components automatically discovered.

CLI Binary

Run as a CLI tool (like Storybook):

npx showcase
# or
node bin/showcase.mjs

Component Structure

Organize your components by framework in src/components/:

src/components/
├── react/
│   ├── Button.tsx
│   └── Button.meta.ts      # Optional: props schema
├── vue/
│   ├── Button.vue
│   └── Button.meta.ts
├── solid/
│   ├── Button.tsx
│   └── Button.meta.ts
├── angular/
│   └── Button.ts
└── lit/
    └── Button.ts

Routes

Components automatically map to routes based on their folder path:

  • src/components/react/Button.tsx/react/button
  • src/components/vue/ui/Card.vue/vue/ui/card

Props Extraction

Showcase automatically extracts component props using multiple strategies:

  1. Meta Files (highest priority): Create .meta.ts files alongside components

    // Button.meta.ts
    export const propsSchema = {
      fields: [
        { name: "label", type: "text", default: "Click me" },
        { name: "disabled", type: "boolean", default: false },
        { name: "variant", type: "text", options: ["primary", "secondary"] }
      ]
    };
  2. Runtime Inspection: React components with propTypes or defaultProps are automatically detected

  3. Function Signatures: Default parameters in function components are inferred

Configuration

Create a showcase.config.ts in your project root:

import { defineShowcaseConfig } from "./src/showcase/config/defaults";

export default defineShowcaseConfig({
  componentsDir: "src/components",  // Default component directory
  presets: ["shadcn"],              // Enable presets
  theme: "light",                   // "light" | "dark"
});

Presets

Shadcn UI

When enabled, Shadcn components follow the @/components/ui pattern. Use the scaffold helpers:

import { scaffoldShadcnButton } from "./showcase/integrations/shadcn";

// Generate a Shadcn-styled Button component
const code = scaffoldShadcnButton("react");

Base UI

Similar support for Base UI (MUI Base) components:

import { scaffoldBaseUiButton } from "./showcase/integrations/baseUi";

const code = scaffoldBaseUiButton("react");

Testing

Visual Snapshot Tests

Write visual tests using Vitest and Playwright:

import { test, expect } from "vitest";
import { ensureViteServer } from "./utils/server";
import { toMatchImageSnapshot } from "vitest-image-snapshot";

expect.extend({ toMatchImageSnapshot });

test("React Button renders correctly", async () => {
  const { page, server } = await ensureViteServer();
  await page.goto("http://localhost:5173/react/button");
  
  const canvas = page.locator('[data-showcase-canvas]');
  await expect(canvas).toHaveScreenshot();
});

Run tests:

# Install Playwright browser first
npx playwright install chromium

# Run tests
npm run test

# Update snapshots
npm run test:update

Framework Switcher

Use the toolbar to switch between frameworks. Click a framework button to:

  1. See what dependencies will be added
  2. Download an updated package.json
  3. Replace your existing file and run npm install

Component Adapters

Components are rendered using framework-specific adapters:

  • React: Uses react-dom/client createRoot
  • Vue: Dynamically imports Vue and uses createApp
  • Solid: Uses solid-js/web renderer
  • Angular: Placeholder (implementation pending)
  • Lit: Placeholder (implementation pending)

Optional Dependencies

Vue and Solid are loaded dynamically. If not installed, components gracefully fail with helpful error messages.

Props Panel

The right-side props panel allows:

  • Editing props defined in the schema
  • Adding custom/extended props on the fly
  • Real-time updates to the component

Extended props are persisted in URL state, so you can share component states via URL.

Development Tips

  1. Fast Refresh: Works seamlessly with Vite's HMR
  2. Type Safety: TypeScript is fully supported
  3. Shadow DOM: Components are completely isolated - no CSS leakage
  4. Lazy Loading: Framework adapters are loaded on-demand

Examples

See src/components/ for example components:

  • React Button with meta file
  • Vue Button with async factory
  • Solid Button with DOM fallback
  • Lit Button example

License

MIT