This is an example repo of using Storybook 7 HTML with stencil web components.
# Install Dependencies
pnpm install
# Start stencil compiler in watch mode
pnpm build --watch
# In a separate terminal, start storybook
pnpm storybook
My custom stencil components are imported and registered in the preview.js
file. This is the only place where I have to import my components as it injects the web-components into Storybook's i-frame. After that, I can use them in any story.
// .storybook/preview.js
import { defineCustomElements } from '../dist/loader';
defineCustomElements();