Storybook for React & Rsbuild lets you develop and test React components in isolation using the Rsbuild toolchain your app already relies on.
| Package | Version |
|---|---|
react | ≥ 16.8 |
@rsbuild/core | ≥ 1.0.1 |
storybook | ≥ 10.0.0 |
Follow these steps inside an existing Rsbuild-powered React project.
Install the framework package to enable React support.
npm install storybook-react-rsbuild -D.storybook/main.tsimport { StorybookConfig } from 'storybook-react-rsbuild'
const config: StorybookConfig = {
framework: 'storybook-react-rsbuild',
rsbuildFinal: (config) => {
// Customize the final Rsbuild config here
return config
},
}
export default configThat's it! Explore the React 16 and React 18 sandboxes for full examples, and continue learning from the Storybook documentation.
Now that you've set up the build system, learn how to write stories and document your components:
Please refer to the Configuration Guide for framework-specific options and defaults.