Storybook for Web Components & Rsbuild is tailored for Lit and custom-element projects, giving you fast component previews without leaving your Rsbuild workflow.
| Package | Version |
|---|---|
lit | ≥ 2 (or ≥ 3) |
@rsbuild/core | ≥ 1.0.1 |
storybook | ≥ 10.0.0 |
Run through these steps inside an Rsbuild project that renders Web Components.
Install the Web Components framework package.
npm install storybook-web-components-rsbuild -D.storybook/main.tsimport { StorybookConfig } from 'storybook-web-components-rsbuild'
const config: StorybookConfig = {
framework: 'storybook-web-components-rsbuild',
rsbuildFinal: (config) => {
// Customize the final Rsbuild config here
return config
},
}
export default configYou're good to go! See the web components sandbox for a complete reference and browse the Storybook docs for deeper guidance.
Please refer to the Configuration Guide for framework-specific options and defaults.