> For AI agents: the complete documentation index is available at /llms.txt, the full documentation bundle is available at /llms-full.txt.

# Vanilla JS / TS

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

## Requirements


| Package | Version |
| --- | --- |
| `@rsbuild/core` | `^1.5.0 \|\| ^2.0.0-0` |
| `storybook` | `^10.6.0` |


## Getting started

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

### Installation

Install the HTML framework package and `@rsbuild/core`. Even though `storybook-html-rsbuild` declares `@rsbuild/core` as a peer, list it as a direct dev dependency so version pins and lockfile audits remain unambiguous.


```sh [npm]
npm install @rsbuild/core storybook-html-rsbuild -D
```

```sh [yarn]
yarn add @rsbuild/core storybook-html-rsbuild -D
```

```sh [pnpm]
pnpm add @rsbuild/core storybook-html-rsbuild -D
```

```sh [bun]
bun add @rsbuild/core storybook-html-rsbuild -D
```

```sh [deno]
deno add npm:@rsbuild/core npm:storybook-html-rsbuild -D
```

### Configure `.storybook/main.ts`

```js
import { StorybookConfig } from 'storybook-html-rsbuild'
import { mergeRsbuildConfig } from '@rsbuild/core'

const config: StorybookConfig = {
  framework: 'storybook-html-rsbuild',
  stories: ['../src/**/*.stories.@(js|mjs|ts)'],
  rsbuildFinal: (config) => {
    // Customize the final Rsbuild config here
    return mergeRsbuildConfig(config, {
      // your custom config
    })
  },
}

export default config
```

You're all set! Review the [vanilla TypeScript sandbox](https://github.com/rstackjs/storybook-rsbuild/tree/main/sandboxes/vanilla-ts) to see the setup in action, and continue exploring the [Storybook docs](https://storybook.js.org/docs).

## Next Steps

- **[Writing Stories](https://storybook.js.org/docs/writing-stories)**: Learn how to write stories for vanilla JavaScript/TypeScript.
- **[Testing](https://storybook.js.org/docs/writing-tests)**: Learn how to test your UI components.

## Options

Please refer to the [Configuration Guide](/guide/configuration.md#framework-options) for framework-specific options and defaults.
