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

@pyreon/storybook

v0.37.1

Published

Storybook renderer for Pyreon — mount, render, and interact with Pyreon components in Storybook

Readme

@pyreon/storybook

Storybook renderer for Pyreon components — mount, render, interact via Storybook's standard tooling.

@pyreon/storybook is the Storybook framework integration for Pyreon. Set framework: "@pyreon/storybook" in .storybook/main.ts and your Pyreon components render in Storybook with the standard Meta / StoryObj types, args, decorators, and play interactions. Ships a renderToCanvas(context, canvasElement) renderer, typed Meta<TComponent> + StoryObj<TMeta> helpers, and convenience re-exports of the core Pyreon primitives (h, Fragment, signal, computed, effect, mount) so stories don't need a second import.

Install

bun add -D @pyreon/storybook storybook

Configure

// .storybook/main.ts
import type { StorybookConfig } from 'storybook'

const config: StorybookConfig = {
  framework: '@pyreon/storybook',
  stories: ['../src/**/*.stories.@(ts|tsx)'],
}

export default config

The framework preset (resolved from @pyreon/storybook/preset) wires the renderer for you. No additional previewAnnotations needed.

Write a story

import type { Meta, StoryObj } from '@pyreon/storybook'
import { Button } from './Button'

const meta = {
  component: Button,
  args: { label: 'Click me' },
} satisfies Meta<typeof Button>

export default meta
type Story = StoryObj<typeof meta>

export const Primary: Story = {
  args: { variant: 'primary' },
}

export const WithSignal: Story = {
  render: (args) => {
    const count = signal(0)
    return (
      <div>
        <Button {...args} onClick={() => count.update((c) => c + 1)} />
        <span>{count()}</span>
      </div>
    )
  },
}

Subpath exports

| Subpath | Surface | | ---------------------------- | -------------------------------------------------------------------------------- | | @pyreon/storybook | Meta, StoryObj, StoryFn, StoryContext, DecoratorFn, InferProps, PyreonRenderer, defaultRender, renderToCanvas, plus Pyreon re-exports (h, Fragment, signal, computed, effect, mount) | | @pyreon/storybook/preset | Storybook framework preset — loaded by .storybook/main.ts when framework: "@pyreon/storybook" | | @pyreon/storybook/preview | Preview annotations entry — registered by the preset |

API

Meta<TComponent>

Story metadata. Use the satisfies operator to get inferred props:

const meta = {
  component: MyComponent,
  args: { label: 'hello' },
  argTypes: { label: { control: 'text' } },
} satisfies Meta<typeof MyComponent>

StoryObj<TMeta>

Story object. Args are inferred from Meta['component']:

type Story = StoryObj<typeof meta>

export const Demo: Story = {
  args: { variant: 'primary' },
  play: async ({ canvasElement }) => { /* ... */ },
}

renderToCanvas(context, canvasElement)

The renderer Storybook calls to mount a story into its canvas iframe. Used internally by the preset — most users never call it directly.

Pyreon re-exports

h, Fragment, signal, computed, effect, mount are re-exported for convenience so stories don't need a second import { signal } from '@pyreon/reactivity'.

Peer dependencies

  • storybook >= 8.0.0

Gotchas

  • Args are passed as props — your component must accept the args shape as its props type. Use the satisfies Meta<typeof Button> form so TS catches mismatches.
  • Storybook's auto-docs work — props are inferred from the component's TS signature via react-docgen-typescript-style introspection.
  • Stories run in a real iframe, so SSR-only paths in your components shouldn't be exercised by stories. Use happy-dom unit tests + Playwright for those.

Documentation

Full docs: pyreon.dev/docs/storybook (or docs/src/content/docs/storybook.md in this repo).

License

MIT