{"_id":"@deniszholob/storybook-auto-titles","_rev":"6-07f3036647d7d1e6df73d15856f098a6","name":"@deniszholob/storybook-auto-titles","dist-tags":{"latest":"0.0.4"},"versions":{"0.0.2":{"name":"@deniszholob/storybook-auto-titles","version":"0.0.2","keywords":["storybook","storybook-addon","storybook-titles","monorepo","nx","angular","react","vue"],"author":{"name":"Denis Zholob"},"license":"MIT","_id":"@deniszholob/storybook-auto-titles@0.0.2","maintainers":[{"name":"deniszholob","email":"dddgamer@live.com"}],"homepage":"https://github.com/deniszholob/storybook-auto-title#readme","bugs":{"url":"https://github.com/deniszholob/storybook-auto-title/issues"},"dist":{"shasum":"8c1dad8f92c3c0b06faf723bdb55e27fa1af1026","tarball":"https://registry.npmjs.org/@deniszholob/storybook-auto-titles/-/storybook-auto-titles-0.0.2.tgz","fileCount":9,"integrity":"sha512-W7S3vtD0FXkbJ2frsIyJB6Sxe7fzLa4MVK5hyLqqpjBKMH4CadvDdOtHDUrWNBDMIvVRVwjoMGTZ/jdYzIikaw==","signatures":[{"sig":"MEQCIDdT9gNNlZA8EdEytzxA8olIHfIosoHq0IU7uv5GkP6bAiAH4S3LmyZvI7bjllQ+Xgy5rPtoY9kuKZLTeR8p9TajaA==","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"attestations":{"url":"https://registry.npmjs.org/-/npm/v1/attestations/@deniszholob%2fstorybook-auto-titles@0.0.2","provenance":{"predicateType":"https://slsa.dev/provenance/v1"}},"unpackedSize":23068},"main":"./index.cjs","type":"module","_from":"file:dist/deniszholob-storybook-auto-titles-0.0.2.tgz","types":"./index.d.ts","module":"./index.js","engines":{"npm":">= 11.4.2","node":">= 22.16.0"},"exports":{".":{"types":"./index.d.ts","import":"./index.js","require":"./index.cjs"}},"_npmUser":{"name":"deniszholob","email":"dddgamer@live.com"},"_resolved":"/home/runner/work/storybook-auto-title/storybook-auto-title/dist/deniszholob-storybook-auto-titles-0.0.2.tgz","_integrity":"sha512-W7S3vtD0FXkbJ2frsIyJB6Sxe7fzLa4MVK5hyLqqpjBKMH4CadvDdOtHDUrWNBDMIvVRVwjoMGTZ/jdYzIikaw==","repository":{"url":"git+https://github.com/deniszholob/storybook-auto-title.git","type":"git"},"_npmVersion":"10.9.4","description":"Automatically generate clean, human-readable Storybook sidebar titles from your file structure.","directories":{},"_nodeVersion":"22.22.0","_hasShrinkwrap":false,"_npmOperationalInternal":{"tmp":"tmp/storybook-auto-titles_0.0.2_1772608013242_0.33930017110521193","host":"s3://npm-registry-packages-npm-production"}},"0.0.3":{"name":"@deniszholob/storybook-auto-titles","version":"0.0.3","keywords":["storybook","storybook-addon","storybook-titles","monorepo","nx","angular","react","vue"],"author":{"name":"Denis Zholob"},"license":"MIT","_id":"@deniszholob/storybook-auto-titles@0.0.3","maintainers":[{"name":"deniszholob","email":"dddgamer@live.com"}],"homepage":"https://github.com/deniszholob/storybook-auto-title#readme","bugs":{"url":"https://github.com/deniszholob/storybook-auto-title/issues"},"dist":{"shasum":"4536816b6a5bebfeadf9176806c886e7b6debe85","tarball":"https://registry.npmjs.org/@deniszholob/storybook-auto-titles/-/storybook-auto-titles-0.0.3.tgz","fileCount":9,"integrity":"sha512-SGyk2GS9MY6H6Fj1hk7+H9FGLLhzqK9EPog7SE2R0xOdlX6Y2vT6vJ5xDqiai7ydSX5Utwj+s09MSddOTrh5ZA==","signatures":[{"sig":"MEYCIQCIxYxBEfQQ/U1V/JsdbHA+fe80nNUBaYyhmP4rc0Vd1QIhANAUr3Rcv0pgdGXzIMd6HdKrO/lGXGTh3wgtm0XUH8O1","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"attestations":{"url":"https://registry.npmjs.org/-/npm/v1/attestations/@deniszholob%2fstorybook-auto-titles@0.0.3","provenance":{"predicateType":"https://slsa.dev/provenance/v1"}},"unpackedSize":80623},"main":"./index.cjs","type":"module","_from":"file:dist/deniszholob-storybook-auto-titles-0.0.3.tgz","types":"./index.d.ts","module":"./index.js","engines":{"npm":">= 11.4.2","node":">= 22.16.0"},"exports":{".":{"types":"./index.d.ts","import":"./index.js","require":"./index.cjs"}},"_npmUser":{"name":"deniszholob","email":"dddgamer@live.com"},"_resolved":"/home/runner/work/storybook-auto-title/storybook-auto-title/dist/deniszholob-storybook-auto-titles-0.0.3.tgz","_integrity":"sha512-SGyk2GS9MY6H6Fj1hk7+H9FGLLhzqK9EPog7SE2R0xOdlX6Y2vT6vJ5xDqiai7ydSX5Utwj+s09MSddOTrh5ZA==","repository":{"url":"git+https://github.com/deniszholob/storybook-auto-title.git","type":"git"},"_npmVersion":"10.9.4","description":"Automatically generate clean, human-readable Storybook sidebar titles from your file structure.","directories":{},"_nodeVersion":"22.22.0","_hasShrinkwrap":false,"_npmOperationalInternal":{"tmp":"tmp/storybook-auto-titles_0.0.3_1773178133043_0.33552275446805946","host":"s3://npm-registry-packages-npm-production"}},"0.0.4":{"name":"@deniszholob/storybook-auto-titles","version":"0.0.4","description":"Automatically generate clean, human-readable Storybook sidebar titles from your file structure.","license":"MIT","author":{"name":"Denis Zholob"},"repository":{"type":"git","url":"git+https://github.com/deniszholob/storybook-auto-title.git"},"keywords":["storybook","storybook-addon","storybook-titles","monorepo","nx","angular","react","vue"],"engines":{"node":">= 22.16.0","npm":">= 11.4.2"},"type":"module","main":"./index.cjs","module":"./index.js","types":"./index.d.ts","exports":{".":{"types":"./index.d.ts","import":"./index.js","require":"./index.cjs"}},"_id":"@deniszholob/storybook-auto-titles@0.0.4","bugs":{"url":"https://github.com/deniszholob/storybook-auto-title/issues"},"homepage":"https://github.com/deniszholob/storybook-auto-title#readme","_integrity":"sha512-1qpGvZU1p3hVULMHv7Wzfgcomgp4VBvsZffC39vLnRG8X8cYhUsdXumwf4KNptrAlQpx1rve5Yg2uD9xmrW6Rw==","_resolved":"/home/runner/work/storybook-auto-title/storybook-auto-title/dist/deniszholob-storybook-auto-titles-0.0.4.tgz","_from":"file:dist/deniszholob-storybook-auto-titles-0.0.4.tgz","_nodeVersion":"22.22.3","_npmVersion":"10.9.8","dist":{"integrity":"sha512-1qpGvZU1p3hVULMHv7Wzfgcomgp4VBvsZffC39vLnRG8X8cYhUsdXumwf4KNptrAlQpx1rve5Yg2uD9xmrW6Rw==","shasum":"cbde1e545650b526382a7bd6026523a8d4f45480","tarball":"https://registry.npmjs.org/@deniszholob/storybook-auto-titles/-/storybook-auto-titles-0.0.4.tgz","fileCount":9,"unpackedSize":86640,"attestations":{"url":"https://registry.npmjs.org/-/npm/v1/attestations/@deniszholob%2fstorybook-auto-titles@0.0.4","provenance":{"predicateType":"https://slsa.dev/provenance/v1"}},"signatures":[{"keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U","sig":"MEYCIQDcEr3KuX+ZVpzEmQteh1+VFrgvGMsmdQ5HPHRzJUL2KAIhAO8ASJSRsIK1LjsHIDz3rq5JwMn0gsibn8XrZQiKMHBE"}]},"_npmUser":{"name":"deniszholob","email":"dddgamer@live.com"},"directories":{},"maintainers":[{"name":"deniszholob","email":"dddgamer@live.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages-npm-production","tmp":"tmp/storybook-auto-titles_0.0.4_1780101223207_0.736196464539971"},"_hasShrinkwrap":false}},"time":{"created":"2026-03-04T07:06:53.136Z","modified":"2026-05-30T00:33:43.649Z","0.0.1":"2026-03-04T05:57:55.416Z","0.0.2":"2026-03-04T07:06:53.403Z","0.0.3":"2026-03-10T21:28:53.205Z","0.0.4":"2026-05-30T00:33:43.363Z"},"bugs":{"url":"https://github.com/deniszholob/storybook-auto-title/issues"},"author":{"name":"Denis Zholob"},"license":"MIT","homepage":"https://github.com/deniszholob/storybook-auto-title#readme","keywords":["storybook","storybook-addon","storybook-titles","monorepo","nx","angular","react","vue"],"repository":{"type":"git","url":"git+https://github.com/deniszholob/storybook-auto-title.git"},"description":"Automatically generate clean, human-readable Storybook sidebar titles from your file structure.","maintainers":[{"name":"deniszholob","email":"dddgamer@live.com"}],"readme":"# Storybook Auto Titles\n\nHuman-readable, automatically generated Storybook sidebar titles — zero per-story boilerplate.\n\nAutomatically transform Storybook’s implicit auto-titles into clean, readable, hierarchical groups based on your file structure.\n\n# Support Me\n\nIf you find the this useful, consider:\n\n- Donating Ko-fi: https://ko-fi.com/deniszholob\n- Supporting on Patreon: https://www.patreon.com/deniszholob\n\n# 🧩 Example\n\nSee https://deniszholob.github.io/storybook-auto-title/ for example storybook deployment\n\n## With @deniszholob/storybook-auto-titles\n\n```\nComponents/Generic/Badge\n```\n\n[![Component Storybook Auto Title](screenshots/component-sb-auto-title.png)](screenshots/component-sb-auto-title.png)\n\n## Default Storybook titles\n\n```\nComponents/generic/badge/badge.component/Badge\n```\n\n[![Component Storybook Default Title](screenshots/component-sb-default-title.png)](screenshots/component-sb-default-title.png)\n\n## File tree\n\n```\nsrc/app/components/generic/badge/badge.component.stories.ts\n```\n\n[![Component Location](screenshots/component-location.png)](screenshots/component-location.png)\n\n# 📦 Installation\n\n## From npm\n\n```bash\npnpm add -D @deniszholob/storybook-auto-titles\n# or\nnpm i -D @deniszholob/storybook-auto-titles\n# or\nyarn add -D @deniszholob/storybook-auto-titles\n```\n\n## Local install (no npm registry)\n\nDownload release asset https://github.com/deniszholob/storybook-auto-title/releases\n\n```bash\npnpm add -D storybook-auto-titles-<version>.tgz\n```\n\n# 🚀 Usage\n\n## .storybook/main.ts\n\n```ts\nimport { autoTitleIndexer, AutoTitleOptions } from '@deniszholob/storybook-auto-titles';\nimport type { StorybookConfig } from '@storybook/angular';\n\nconst config: StorybookConfig = {\n  stories: ['../src/**/*.stories.@(ts|tsx|js|jsx|mdx)'],\n  experimental_indexers: autoTitleIndexer({\n    // Config Options\n  } satisfies AutoTitleOptions),\n};\n\nexport default config;\n```\n\nFor MDX docs, prefer attached docs with `Meta of={...}` so the docs page inherits the same auto-title path as its story file.\n\n# ⚙️ Configuration\n\n```ts\nexperimental_indexers: autoTitleIndexer({\n  stripPrefixes: ['libs/', 'src/app/'],\n  stripPathSegments: ['src'],\n  dedupeAdjacent: true,\n  stripSegmentSuffixes: ['widget'],\n  stripSegmentSuffixesMode: 'add',\n});\n```\n\nTo ignore folder names like `src` anywhere in the title path, use `stripPathSegments`.\n\nExample:\n\n```ts\nexperimental_indexers: autoTitleIndexer({\n  stripPathSegments: ['src'],\n  stripSegmentSuffixes: [],\n  stripSegmentSuffixesMode: 'replace',\n});\n```\n\nPath/title example:\n\n- `libs/libname/src/component-name/component-name.stories.ts` -> `Libname/Component Name`\n\n## Config Options\n\n| Option                   | Type                  | Default    | Description                                                     |\n| ------------------------ | --------------------- | ---------- | --------------------------------------------------------------- |\n| stripPrefixes            | `string[]`            | `[]`       | Removes leading path segments before processing                 |\n| stripPathSegments        | `string[]`            | `[]`       | Removes matching full path segments anywhere (case-insensitive) |\n| dedupeAdjacent           | `boolean`             | `true`     | Removes repeated adjacent folder names                          |\n| segmentTransform         | `(segment) => string` | Title Case | Custom label formatter (return `''` to remove a segment)        |\n| flattenTitle             | `(title) => string`   | internal   | Full override for custom pipelines                              |\n| stripSegmentSuffixes     | `string[]`            | `[]`       | Extra or replacement suffixes to strip (without leading `.`)    |\n| stripSegmentSuffixesMode | `'add' \\| 'replace'`  | `'add'`    | `add` merges with defaults; `replace` uses only your list       |\n\nDefault stripped suffixes include Angular + Storybook values:\n`component`, `directive`, `service`, `pipe`, `module`, `guard`, `resolver`, `interceptor`, `stories`, `story`.\n\nStory names are also synced with the story file suffix:\n\n- if suffix is stripped, `Tooltip Directive` becomes `Tooltip`\n- if suffix is not stripped (for example replace with `[]`), `Tooltip` becomes `Tooltip Directive`\n- if a raw name still looks like a filename, it is humanized automatically\n\n# ✨ Features\n\n- ✅ Storybook 8, 9, and 10+ compatible (storybook versions with experimental_indexers)\n- ✅ Framework agnostic (Angular, React, Vue, Web Components, etc.)\n- ✅ Keeps Storybook’s auto-title logic (uses `makeTitle`)\n- ✅ Converts kebab-case / snake_case / dotted names → Title Case\n- ✅ Removes noisy suffixes like `.component`, `.directive`, `.service`, `.stories`, etc...\n- ✅ Keeps story names in sync with suffix stripping rules\n- ✅ Preserves nested component folders when child folders also contain stories/docs\n- ✅ Deduplicates repeated path segments\n- ✅ Optional prefix stripping (`src/app`, `libs/ui`, etc.)\n- ✅ No changes required in your story files\n- ✅ ESM + CJS compatible\n- ✅ Monorepo and Nx friendly\n\n# 🧠 Why this exists\n\nWithout this, you would either:\n\n- manually setting `title` in every story to achieve pretty title (hard to manage)\n- use the defaults (not as friendly, and requires more clicks)\n\n# 🏗 How it works\n\nWe hook into Storybook’s experimental indexer API and:\n\n1. Ask Storybook for the correct implicit title via `options.makeTitle()`\n2. Transform the result into a human-readable hierarchy\n3. Sync raw story names with the file suffix when needed\n4. Remove stale `__id` values so HMR and CSF imports stay stable\n","readmeFilename":"README.md"}