Use Storybook for vanilla JavaScript or TypeScript projects to preview UI components while keeping your Rsbuild pipeline intact.
| Package | Version |
|---|---|
@rsbuild/core | ≥ 1.0.1 |
storybook | ≥ 10.0.0 |
These steps assume you already have an Rsbuild project without a specific framework.
Install the HTML framework package to enable vanilla stories.
npm install storybook-html-rsbuild -D.storybook/main.tsimport { StorybookConfig } from 'storybook-html-rsbuild'
const config: StorybookConfig = {
framework: 'storybook-html-rsbuild',
rsbuildFinal: (config) => {
// Customize the final Rsbuild config here
return config
},
}
export default configYou're all set! Review the vanilla TypeScript sandbox to see the setup in action, and continue exploring the Storybook docs.
Please refer to the Configuration Guide for framework-specific options and defaults.