Using Storybook
Storybook is a tool specifically designed for component debugging. It provides:
- A rich variety of debugging capabilities
- Integration with some testing tools
- Reusable documentation content
- Sharing capabilities
- Workflow automation
Principle
Rsbuild provides Storybook Rsbuild, which allows any Rsbuild project to use this tool for building Storybook.
Modern.js implements storybook-addon-modernjs based on this tool. This plugin loads the Modern.js configuration file and converts it into a configuration usable by Storybook Rsbuild.
Info
This document only provides the simplest usage. For more information, please refer to Storybook Rsbuild Modern.js Integration.
Installation
You need to install @rsbuild/core in your project, otherwise the plugin may not work properly.
Configure .storybook/main.ts
Example
You can check out the example to learn how to use Storybook in Modern.js.