Storybook for Svelte & Webpack

Storybook for Svelte & Webpack is a framework that makes it easy to develop and test UI components in isolation for applications using Svelte built with Webpack.

Storybook for Svelte & Webpack is only supported in Svelte projects.


  • Svelte ≥ 4.0
  • Webpack ≥ 5.0
  • Storybook ≥ 8.0

Getting started

In a project without Storybook

Follow the prompts after running this command in your Svelte project's root directory:

More on getting started with Storybook.

In a project with Storybook

This framework is designed to work with Storybook 7+. If you’re not already using v7, upgrade with this command:

Automatic migration

When running the upgrade command above, you should get a prompt asking you to migrate to @storybook/svelte-webpack5, which should handle everything for you. In case that auto-migration does not work for your project, refer to the manual migration below.

Manual migration

First, install the framework:

Next, install and register your appropriate compiler addon, depending on whether you're using SWC (recommended) or Babel:


More details can be found in the Webpack builder docs.

Finally, update your .storybook/main.js|ts to change the framework property:

Writing native Svelte stories

Storybook provides a Svelte addon maintained by the community, enabling you to write stories for your Svelte components using the template syntax. You'll need to take some additional steps to enable this feature.

Run the following command to install the addon.

The community actively maintains the Svelte CSF addon but still lacks some features currently available in the official Storybook Svelte framework support. For more information, see the addon's documentation.



You can pass an options object for additional configuration if needed:


The available options are:


Type: Record<string, any>

Configure options for the framework's builder. For this framework, available options can be found in the Webpack builder docs.

Was this page helpful?

Markdown accepted ([link text](url), _italic_, **bold**, etc). Your anonymous feedback will be posted publicly on GitHub.

✍️ Edit on GitHub – PRs welcome!
Join the community
6,613 developers and counting
WhyWhy StorybookComponent-driven UI
CommunityAddonsGet involvedBlog
ShowcaseExploreProjectsComponent glossary
Open source software

Maintained by
Special thanks to Netlify and CircleCI