React
Storybook for React & Rsbuild lets you develop and test React components in isolation using the Rsbuild toolchain your app already relies on.
Requirements
| Package | Version |
|---|---|
react | ≥ 18 |
@rsbuild/core | ^2.0.0 |
storybook | ^11.0.0-rc.1 |
Getting started
Follow these steps inside an existing Rsbuild-powered React project.
Installation
Install the framework package and @rsbuild/core. Even though storybook-react-rsbuild declares @rsbuild/core as a peer, list it as a direct dev dependency so version pins and lockfile audits remain unambiguous.
Configure .storybook/main.ts
That's it! Explore the React 18 sandbox for a full example, and continue learning from the Storybook documentation.
Next Steps
Now that you've set up the build system, learn how to write stories and document your components:
- Writing Stories: Learn the basics of Component Story Format (CSF).
- Auto-docs: Automatically generate documentation from your components.
Options
Please refer to the Configuration Guide for framework-specific options and defaults.