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

@component-labs/nextjs-showcase

v0.1.1

Published

A lightweight component showcase tool for Next.js with SSR support

Readme

@component-labs/nextjs-showcase

A lightweight, fast, and developer-friendly component showcase tool for Next.js with server-side rendering (SSR) support. Built with Next.js 15+ and the App Router.

Features

  • 🚀 Server-side rendering - Components render on the server for better SEO and performance
  • 📦 Zero config - Works out of the box with auto-detection
  • 🔥 Hot reload - Instant updates as you code with Next.js Fast Refresh
  • 🎛️ Interactive props - Control component props in real-time
  • 🎯 Type-safe - Full TypeScript support
  • 🎨 Dark mode - Built-in theme switching
  • 📱 Static export - Deploy anywhere as a static site

Quick Start

1. Install the Package

Add Component Labs Next.js Showcase to your project:

npm install @component-labs/nextjs-showcase
pnpm add @component-labs/nextjs-showcase
yarn add @component-labs/nextjs-showcase

That's it! The package will automatically build the CLI during installation via the postinstall hook.

2. Initialize Configuration

Create a showcase configuration file:

npx nextjs-showcase init

This creates a showcase.config.ts file in your project root.

3. Run the Showcase

Start the development server:

npx nextjs-showcase dev

The CLI will automatically build itself before starting if needed. Your showcase will open at http://localhost:3060

Alternative: Package Scripts

You can also add these to your package.json for easier access:

{
  "scripts": {
    "showcase": "nextjs-showcase dev",
    "showcase:build": "nextjs-showcase build"
  }
}

Then run with:

npm run showcase

Configuration

Edit showcase.config.ts to customize your showcase:

import { defineConfig } from "@component-labs/nextjs-showcase/config";

export default defineConfig({
  // Pattern to match your showcase files
  showcasePaths: ["src/**/*.showcase.{tsx,jsx}"],

  // Optional: Exclude certain paths
  exclude: ["node_modules/**", "dist/**"],

  // Optional: Custom title
  title: "My Component Library",

  // Optional: Port for dev server (default: 3060)
  port: 3060,

  // Optional: Path to global CSS file
  globalCss: "./src/styles/globals.css",

  // Optional: Path to global provider component
  globalProvider: "./src/GlobalProvider.tsx",
});

Creating Showcases

Basic Showcase

Create a file with the *.showcase.tsx extension:

import { YourComponent } from "./YourComponent";

// Define metadata
export default {
  title: "YourComponent",
};

// Create showcase variants
export function Basic() {
  return <YourComponent />;
}

export function WithProps() {
  return <YourComponent text="Hello World" />;
}

Interactive Controls

Add interactive props to let users experiment with your components:

import { Button } from "./Button";
import type { Props } from "@component-labs/nextjs-showcase";

export default {
  title: "Button",
};

export function Interactive() {
  return (
    <Button variant="primary" size="medium">
      Click Me
    </Button>
  );
}

// Define interactive controls
Interactive.props = {
  variant: {
    type: "select",
    label: "Variant",
    default: "primary",
    options: ["primary", "secondary", "outline"],
  },
  size: {
    type: "select",
    label: "Size",
    default: "medium",
    options: ["small", "medium", "large"],
  },
  disabled: {
    type: "boolean",
    label: "Disabled",
    default: false,
  },
  children: {
    type: "string",
    label: "Text",
    default: "Click Me",
  },
} satisfies Props;

CLI Commands

init

Create a new showcase.config.ts file:

npx nextjs-showcase init

Options:
  -f, --force    Overwrite existing config file

dev

Start the Next.js development server:

npx nextjs-showcase dev

Options:
  -p, --port <port>      Port to run the dev server on
  -c, --config <path>    Path to config file

build

Build the showcase for production deployment:

npx nextjs-showcase build

Options:
  -c, --config <path>    Path to config file
  -o, --out-dir <path>   Output directory

Deployment

Build and deploy to any static host:

npx nextjs-showcase build

The static files will be generated in the out directory (configurable).

Compatible with:

  • Vercel
  • Netlify
  • GitHub Pages
  • Cloudflare Pages
  • AWS S3 + CloudFront
  • Any static hosting service

Differences from @component-labs/react-showcase

  • SSR Support: Components render on the server by default
  • Next.js App Router: Uses Next.js 15+ with App Router instead of Vite
  • Better SEO: Server-rendered pages are SEO-friendly
  • Static Export: Easy static site generation for deployment

License

AGPL-3.0 © Benjamin Davies

Links