A Stencil compiler integration for Storybook (v8). Current stable version 0.2.3, published April 2024. Integrates with @storybook/web-components-vite to transpile Stencil components on the fly, automatically handling custom element definition, dependencies, and HMR. Key differentiators: eliminates need for manual defineCustomElements calls, extracts ArgTypes and Controls from Stencil source, and manages CSS and component imports via Vite plugins. Requires Stencil v4 and Storybook v8. Peer dependency on TypeScript ^5.4.3. Limited adoption; last release over a year ago.
npm install storybook-addon-stencilNo compatibility data collected yet for this library.
Verified import paths — ran on the pinned version, not inferred.
Minimal setup to add the addon, register it in Storybook config, and import a Stencil component in a story.
Upgrade Stencil to ^4.0.0 and Storybook to ^8.0.0.
Switch to @storybook/web-components-vite and remove any webpack-related addons.
Remove defineCustomElements() from .storybook/preview.js.
Add import './my-component' at the top of each story file for every component used.
Use <ArgTypes of={Default} /> in MDX files instead of relying on autodocs.Upgrade to >=0.2.0, or import from 'storybook-addon-stencil' (but only the addon entry point).
Remove defineCustomElements() from .storybook/preview.js.
Switch framework to '@storybook/web-components-vite' in Storybook config.
Run stencil build first, or ensure storybook: true in Stencil config for HMR.