Vanilla JS / TS

Storybook for vanilla JavaScript / TypeScript & Rsbuild is a framework that makes it easy to develop and test UI components in isolation for applications built with Rsbuild.

Requirements
  • @rsbuild/core ≥ 1.0.1
  • Storybook ≥ 8.2.1

Getting started

Use with vanilla JavaScript / TypeScript in a existing Rsbuild project.

Installation

To use vanilla JavaScript / TypeScript with Storybook, you need to install the storybook-html-rsbuild package.

npm
yarn
pnpm
bun
npm storybook-html-rsbuild -D

Setup .storybook/main.ts

import { StorybookConfig } from 'storybook-html-rsbuild'

const config: StorybookConfig = {
  framework: 'storybook-html-rsbuild',
  rsbuildFinal: (config) => {
    // Customize the final Rsbuild config here
    return config
  },
}

export default config

You're all set now. You could also check out the example in sandboxes/vanilla-ts and use all other features listed in Storybook site.