Vanilla JS / TS

Use Storybook for vanilla JavaScript or TypeScript projects to preview UI components while keeping your Rsbuild pipeline intact.

Requirements
  • @rsbuild/core ≥ 1.0.1
  • storybook ≥ 9.0.0

Getting started

These steps assume you already have an Rsbuild project without a specific framework.

Installation

Install the HTML framework package to enable vanilla stories.

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

Configure .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! Review the vanilla TypeScript sandbox to see the setup in action, and continue exploring the Storybook docs.

Options

The framework's types.ts file documents every available option.