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

storybook-vrhythm

v0.4.0

Published

Baseline grid overlay for Storybook — see your vertical rhythm while you build

Readme

storybook-vrhythm

npm version License: MIT Bundle Size Zero Dependencies

Baseline grid overlay for Storybook. See your vertical rhythm while you build.

Stop guessing if your spacing is consistent. storybook-vrhythm draws a customizable baseline grid on top of your stories so you can see alignment issues as you develop — not after you ship.

Features

  • Framework agnostic — React, Vue, Angular, Svelte, Web Components, HTML
  • Toolbar toggle — Show/hide the grid from Storybook's toolbar, no reload needed
  • Built-in presets — Material, Tailwind, Bootstrap, and pixel-based grids ready to use
  • Column grids — Optional vertical column overlay with configurable gutter width
  • Fully customizable — Color, line height, line width, offset, opacity, z-index, max width
  • Lightweight — Pure CSS overlay via linear-gradient. Zero runtime dependencies
  • Non-intrusivepointer-events: none keeps your stories fully interactive
  • TypeScript first — Full type safety with Storybook parameter augmentation

Requirements

  • Node.js 20+
  • Storybook 10+

Quick start

pnpm add -D storybook-vrhythm
# or: npm install --save-dev storybook-vrhythm
# or: yarn add -D storybook-vrhythm

Add to .storybook/main.ts:

const config = {
  addons: ['storybook-vrhythm'],
};

export default config;

Done. A baseline grid overlay is now visible on every story, toggleable from the toolbar.

Configuration

Global defaults

Set defaults for all stories in .storybook/preview.ts:

export const parameters = {
  vrhythm: {
    color: 'rgba(99, 102, 241, 0.2)',
    lineHeight: '8px',
  },
};

Per-story overrides

export const Compact = {
  parameters: {
    vrhythm: { lineHeight: '4px', color: 'rgba(244, 67, 54, 0.15)' },
  },
};

export const NoGrid = {
  parameters: {
    vrhythm: { hide: true },
  },
};

Using presets

Skip manual configuration with built-in presets that match popular design systems:

export const MaterialGrid = {
  parameters: {
    vrhythm: { preset: 'material' },
  },
};

| Preset | Line height | Color | Best for | | ----------- | ----------- | -------------------------- | ------------------------- | | 4px | 4px | rgba(0, 150, 255, 0.15) | Dense UIs, compact grids | | 8px | 8px | rgba(0, 150, 255, 0.2) | Standard 8pt grid systems | | 16px | 16px | rgba(204, 204, 204, 0.5) | Body text baseline | | 24px | 24px | rgba(204, 204, 204, 0.5) | Heading alignment | | material | 4px | rgba(244, 67, 54, 0.15) | Material Design | | tailwind | 4px | rgba(99, 102, 241, 0.15) | Tailwind CSS | | bootstrap | 8px | rgba(13, 110, 253, 0.2) | Bootstrap |

Column grid

Add vertical column lines on top of the horizontal baseline:

export const ColumnGrid = {
  parameters: {
    vrhythm: {
      lineHeight: '8px',
      columnWidth: '80px',
      gutterWidth: '16px',
      columnColor: 'rgba(99, 102, 241, 0.1)',
    },
  },
};

Manual decorator

If you prefer to opt out of the addon preset:

import { withVRhythm } from 'storybook-vrhythm';

export const decorators = [withVRhythm];

Options

Style options

| Option | Type | Default | Description | | ------------- | ------------------ | ---------------------- | -------------------------------------------------- | | color | string | 'rgb(204, 204, 204)' | CSS color for horizontal guide lines | | lineHeight | string \| number | '16px' | Baseline grid height ('8px', '1rem', etc.) | | lineWidth | string \| number | '1px' | Thickness of each horizontal guide line | | offset | string \| number | 0 | Vertical offset from the top of the container | | opacity | number | 1 | Overlay opacity (0–1) | | zIndex | number | 9999 | Stack order of the overlay | | maxWidth | string \| number | — | Centers the overlay with this max width | | columnWidth | string \| number | — | Repeating column width for a vertical column grid | | columnColor | string | — | CSS color for column lines (falls back to color) | | gutterWidth | string \| number | — | Gutter between columns (requires columnWidth) |

Config options

| Option | Type | Default | Description | | ----------- | --------- | ------- | ------------------------------------------------------------------ | | hide | boolean | false | Hide the overlay for this story (overrides toolbar toggle) | | preset | string | — | Built-in preset name (see table above) | | container | string | — | CSS selector for the overlay's parent element (defaults to body) |

Parameter resolution order

DEFAULT_PARAMS → preset styles → story-level parameters

Later sources override earlier ones. The story-level hide param takes precedence over the toolbar toggle.

Why vertical rhythm?

Vertical rhythm is the practice of aligning elements to a consistent baseline grid. When text, images, and components share the same vertical cadence, layouts feel cohesive and polished — even if users can't articulate why.

This addon makes the invisible grid visible during development, so spacing inconsistencies get caught in Storybook instead of production.

Contributing

Contributions are welcome! Feel free to open an issue or submit a pull request.

License

MIT