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

@merkur/tool-storybook

v1.0.3

Published

Merkur integration to storybook tool.

Downloads

501

Readme

Merkur - tool-storybook

Build Status NPM package version npm bundle size (scoped version) code style: prettier

Integrates Storybook with Merkur widgets. The package handles the widget lifecycle (create → mount → unmount) inside the Storybook loader pipeline, so your story files stay focused on rendering.

Full documentation and setup guide.

Installation

npm install --save-dev @merkur/tool-storybook

API

| Export | Description | |--------|-------------| | createPreviewConfig(options) | Registers a widget with Merkur and returns a partial Storybook preview.mjs config ({ loaders }). Spread into your preview export. | | createVanillaRenderer() | Creates a render/update pair for vanilla JS widgets that produce HTML strings. | | createWidgetLoader(options) | Low-level loader factory used internally by createPreviewConfig. Use directly when you need full control over widget registration. |

createPreviewConfig options

| Option | Type | Required | Description | |--------|------|----------|-------------| | widgetProperties | Object | ✅ | Widget definition object — must include name and version. | | render | Function | — | Called each time widget.update() fires, receives the widget instance. Defaults to a no-op. | | createWidget | Function | — | Widget factory. Defaults to createMerkurWidget from @merkur/core. |

createVanillaRenderer

createVanillaRenderer() takes no arguments.

  • Stories must provide args.component as a function (widget) => htmlString.
  • Event binding: define bindEventListeners(widget, container) (and optionally unbindEventListeners(widget, container)) directly on the widget inside its createWidget factory. The renderer calls widget.bindEventListeners(container) after each render and widget.unbindEventListeners(container) before each re-render. widget is auto-injected as the first argument by Merkur's bindWidgetToFunctions, so the signature in the definition must include widget as the first parameter.
  • Security: args.component is responsible for HTML-escaping any dynamic values before returning the HTML string. Raw interpolation of user-controlled strings is injected via innerHTML as-is.

Peer dependencies

This package requires Storybook ≥ 10 (storybook/preview-api and storybook/internal/core-events are imported at runtime). Installing it alongside Storybook < 10 will cause a module-not-found error.

About Merkur

Merkur is a tiny extensible JavaScript library for front-end microservices. It supports server-side rendering out of the box and works with Preact, µhtml, Svelte, vanilla JS, and more.