{"id":20930328,"url":"https://github.com/jmlweb/storybook-vrhythm","last_synced_at":"2026-04-02T22:27:11.266Z","repository":{"id":34922770,"uuid":"190487297","full_name":"jmlweb/storybook-vrhythm","owner":"jmlweb","description":"Storybook Vertical Rhythm Decorator","archived":false,"fork":false,"pushed_at":"2023-01-04T21:47:37.000Z","size":1691,"stargazers_count":20,"open_issues_count":13,"forks_count":2,"subscribers_count":0,"default_branch":"master","last_synced_at":"2024-04-24T13:36:24.454Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","language":"TypeScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/jmlweb.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":"CONTRIBUTING.md","funding":null,"license":"LICENSE","code_of_conduct":"CODE_OF_CONDUCT.md","threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2019-06-06T00:25:50.000Z","updated_at":"2023-03-05T01:05:26.000Z","dependencies_parsed_at":"2023-01-15T10:30:16.468Z","dependency_job_id":null,"html_url":"https://github.com/jmlweb/storybook-vrhythm","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jmlweb%2Fstorybook-vrhythm","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jmlweb%2Fstorybook-vrhythm/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jmlweb%2Fstorybook-vrhythm/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jmlweb%2Fstorybook-vrhythm/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/jmlweb","download_url":"https://codeload.github.com/jmlweb/storybook-vrhythm/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":225254361,"owners_count":17445169,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-11-18T21:32:00.518Z","updated_at":"2026-04-02T22:27:11.261Z","avatar_url":"https://github.com/jmlweb.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# storybook-vrhythm\n\n[![npm version][npm-badge]][npm]\n[![License: MIT][license-badge]][license]\n[![Bundle Size](https://img.shields.io/bundlephobia/minzip/storybook-vrhythm)](https://bundlephobia.com/package/storybook-vrhythm)\n[![Zero Dependencies](https://img.shields.io/badge/dependencies-0-brightgreen)](https://www.npmjs.org/package/storybook-vrhythm)\n\n\u003e Baseline grid overlay for Storybook. See your vertical rhythm while you build.\n\n![Vertical rhythm overlay example](storybook-vrhythm.jpg)\n\nStop 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.\n\n## Features\n\n- **Framework agnostic** — React, Vue, Angular, Svelte, Web Components\n- **Toolbar toggle** — Show/hide the grid from Storybook's toolbar, no reload needed\n- **Built-in presets** — Material, Tailwind, Bootstrap, and pixel-based grids ready to use\n- **Fully customizable** — Color, line height, offset, opacity, z-index, and column grids\n- **Lightweight** — Pure CSS overlay via `linear-gradient`. Zero runtime dependencies\n- **Non-intrusive** — `pointer-events: none` keeps your stories fully interactive\n- **TypeScript first** — Full type safety with parameter augmentation\n\n## Quick start\n\n```bash\npnpm add -D storybook-vrhythm\n```\n\n\u003cdetails\u003e\n\u003csummary\u003enpm / yarn\u003c/summary\u003e\n\n```bash\nnpm install --save-dev storybook-vrhythm\n# or\nyarn add -D storybook-vrhythm\n```\n\n\u003c/details\u003e\n\nAdd it to `.storybook/main.ts`:\n\n```typescript\nconst config = {\n  addons: ['storybook-vrhythm'],\n};\n\nexport default config;\n```\n\nDone. A baseline grid overlay is now visible on every story, toggleable from the toolbar.\n\n## Configuration\n\n### Global defaults\n\nSet defaults for all stories in `.storybook/preview.ts`:\n\n```typescript\nexport const parameters = {\n  vrhythm: {\n    color: 'rgba(99, 102, 241, 0.2)',\n    lineHeight: '8px',\n    offset: 0,\n  },\n};\n```\n\n### Per-story overrides\n\n```typescript\nexport const Compact = {\n  parameters: {\n    vrhythm: { lineHeight: '4px', color: 'rgba(244, 67, 54, 0.15)' },\n  },\n};\n\nexport const NoGrid = {\n  parameters: {\n    vrhythm: { hide: true },\n  },\n};\n```\n\n### Using presets\n\nSkip manual configuration with built-in presets that match popular design systems:\n\n```typescript\nexport const MaterialGrid = {\n  parameters: {\n    vrhythm: { preset: 'material' },\n  },\n};\n```\n\n| Preset      | Line height | Color                            | Best for                  |\n| ----------- | ----------- | -------------------------------- | ------------------------- |\n| `4px`       | 4px         | `rgba(0, 150, 255, 0.15)`       | Dense UIs, compact grids  |\n| `8px`       | 8px         | `rgba(0, 150, 255, 0.2)`        | Standard 8pt grid systems |\n| `16px`      | 16px        | `rgba(204, 204, 204, 0.5)`      | Body text baseline        |\n| `24px`      | 24px        | `rgba(204, 204, 204, 0.5)`      | Heading alignment         |\n| `material`  | 4px         | `rgba(244, 67, 54, 0.15)`       | Material Design           |\n| `tailwind`  | 4px         | `rgba(99, 102, 241, 0.15)`      | Tailwind CSS              |\n| `bootstrap` | 8px         | `rgba(13, 110, 253, 0.2)`       | Bootstrap                 |\n\n### Manual decorator\n\nIf you prefer not to use the addon preset, import the decorator directly:\n\n```typescript\nimport { withVRhythm } from 'storybook-vrhythm';\n\nexport const decorators = [withVRhythm];\n```\n\n## Options\n\n| Option        | Type               | Default                | Description                                  |\n| ------------- | ------------------ | ---------------------- | -------------------------------------------- |\n| `color`       | `string`           | `'rgb(204, 204, 204)'` | CSS color for horizontal guide lines         |\n| `lineHeight`  | `string \\| number` | `'16px'`               | Baseline grid height (`16px`, `1rem`, etc.)  |\n| `offset`      | `string \\| number` | `0`                    | Vertical offset from the top                 |\n| `opacity`     | `number`           | `1`                    | Overlay opacity (0–1)                        |\n| `zIndex`      | `number`           | `9999`                 | Stack order of the overlay                   |\n| `columnWidth` | `string \\| number` | —                      | Vertical column width for column grids       |\n| `columnColor` | `string`           | —                      | CSS color for vertical column lines          |\n| `hide`        | `boolean`          | `false`                | Hide the overlay for specific stories        |\n| `preset`      | `string`           | —                      | Use a built-in preset (see table above)      |\n| `container`   | `string`           | —                      | CSS selector for the overlay's parent element|\n\n## Why vertical rhythm?\n\nVertical 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.\n\nThis addon makes the invisible grid visible during development, so spacing inconsistencies get caught in Storybook instead of production.\n\n## Requirements\n\n- Node.js 20+\n- Storybook 10+\n\n## Contributing\n\nContributions are welcome! Feel free to open an [issue](https://github.com/jmlweb/storybook-vrhythm/issues) or submit a pull request.\n\n## Inspiration\n\n[Baseliner](https://jpedroribeiro.com/2015/08/baseliner-my-first-chrome-extension/) — a Chrome extension by JP Ribeiro for overlaying baseline grids.\n\n## License\n\n[MIT](LICENSE)\n\n[npm-badge]: https://img.shields.io/npm/v/storybook-vrhythm.svg\n[npm]: https://www.npmjs.org/package/storybook-vrhythm\n[license-badge]: https://img.shields.io/badge/license-MIT-blue.svg\n[license]: https://github.com/jmlweb/storybook-vrhythm/blob/master/LICENSE\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjmlweb%2Fstorybook-vrhythm","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fjmlweb%2Fstorybook-vrhythm","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjmlweb%2Fstorybook-vrhythm/lists"}