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

@chungsam95/component-canvas

v0.1.3

Published

Render real Svelte components in an interactive storyboard canvas. Define workflows as screens + transitions, and component-canvas gives you a pannable, zoomable canvas with live previews, variant states, and visual diffs.

Readme

@chungsam95/component-canvas

Render real Svelte components in an interactive storyboard canvas. Define workflows as screens + transitions, and component-canvas gives you a pannable, zoomable canvas with live previews, variant states, and visual diffs.

Install

npm install -D @chungsam95/component-canvas
# or
pnpm add -D @chungsam95/component-canvas

Quick start

1. Initialize

npx component-canvas init

This creates a .canvas/ directory with an example workflow.

2. Define a workflow

Each workflow lives in .canvas/workflows/<name>/ and has a _flow.ts file describing the screens and transitions:

// .canvas/workflows/auth/_flow.ts
export default {
  id: 'auth',
  title: 'Authentication',
  screens: [
    {
      id: 'login',
      component: './LoginForm.svelte',
      title: 'Login',
      props: { submitLabel: 'Sign in' }
    },
    {
      id: 'dashboard',
      component: './Dashboard.svelte',
      title: 'Dashboard',
      props: { username: 'Sam' }
    }
  ],
  transitions: [
    { from: 'login', to: 'dashboard', trigger: 'Login success' }
  ],
  variants: [
    {
      id: 'login-error',
      screenId: 'login',
      title: 'Invalid credentials',
      props: { error: 'Invalid email or password.' }
    }
  ]
};

Screen components are standard Svelte files — the same components your app uses. Place them alongside _flow.ts or reference them from your project's src/ directory.

3. Start the dev server

npx component-canvas dev

Opens an interactive canvas at http://localhost:5173 with:

  • Pan and zoom navigation
  • Live component previews in iframes
  • Workflow arrows showing screen transitions
  • Variant states for each screen
  • Thumbnail caching (persists across refreshes via IndexedDB)
  • Viewport culling (only renders visible nodes)

4. Add a script (recommended)

{
  "scripts": {
    "canvas": "component-canvas dev"
  }
}

Then npm run canvas or pnpm canvas.

Configuration

Optional canvas.config.ts in your project root:

export default {
  mocks: {
    // Mock SvelteKit runtime modules for canvas isolation
    '$app/stores': './.canvas/mocks/$app/stores.js',
    '$app/navigation': './.canvas/mocks/$app/navigation.js',
  }
};

CLI commands

| Command | Description | |---------|-------------| | component-canvas dev | Start the dev server with live preview canvas | | component-canvas init | Scaffold .canvas/ directory with example workflow | | component-canvas list | List discovered workflows and screens | | component-canvas screenshot [workflow] | Capture screens as PNG files | | component-canvas explore <path> | Extract props/events from a Svelte component |

All commands support --json for machine-readable output and --help for usage details.

How it works

The canvas renders each screen as a live iframe served by a Vite dev server that reuses your project's Vite config, Svelte plugins, and Tailwind setup. Components render with real props in isolation — no mocking of the component itself, just the external dependencies (stores, navigation, etc.) that don't exist outside your app's runtime.

Releasing (maintainers)

Publishes to npm via GitHub Actions with trusted publishing (OIDC — no tokens needed):

# 1. Bump version
npm version patch   # or minor, major

# 2. Push with tag
git push --follow-tags

# 3. GitHub Action builds and publishes automatically