Skip to content

Latest commit

 

History

History
107 lines (73 loc) · 3.77 KB

install.md

File metadata and controls

107 lines (73 loc) · 3.77 KB
title
Install Storybook

Use the Storybook CLI to install it in a single command. Run this inside your existing project’s root directory:

<CodeSnippets paths={[ 'common/init-command.npx.mdx', 'common/init-command.pnpm.mdx', ]} />

If you run into issues with the installation, check the Troubleshooting section below for guidance on how to solve it.

storybook init is not made for empty projects

Storybook needs to be installed into a project that is already set up with a framework. It will not work on an empty project. There are many ways to bootstrap an app in a given framework, including:

Storybook will look into your project's dependencies during its install process and provide you with the best configuration available.

The command above will make the following changes to your local environment:

  • 📦 Install the required dependencies.
  • 🛠 Setup the necessary scripts to run and build Storybook.
  • 🛠 Add the default Storybook configuration.
  • 📝 Add some boilerplate stories to get you started.
  • 📡 Set up telemetry to help us improve Storybook. Read more about it here.

Depending on your framework, first, build your app and then check that everything worked by running:

<CodeSnippets paths={[ 'angular/storybook-run-dev.with-builder.js.mdx', 'common/storybook-run-dev.npm.js.mdx', 'common/storybook-run-dev.yarn.js.mdx', 'common/storybook-run-dev.pnpm.js.mdx', ]} />

It will start Storybook locally and output the address. Depending on your system configuration, it will automatically open the address in a new browser tab, and you'll be greeted by a welcome screen.

Storybook welcome screen

There are some noteworthy items here:

  • A collection of useful links for more in-depth configuration and customization options you have at your disposal.
  • A second set of links for you to expand your Storybook knowledge and get involved with the ever-growing Storybook community.
  • A few example stories to get you started.

Troubleshooting

Below are some of the most common installation issues and instructions on how to solve them.

<FeatureSnippets paths={[ 'get-started/installation-problems/angular.mdx', 'get-started/installation-problems/ember.mdx', 'get-started/installation-problems/html.mdx', 'get-started/installation-problems/preact.mdx', 'get-started/installation-problems/react.mdx', 'get-started/installation-problems/svelte.mdx', 'get-started/installation-problems/vue.mdx', 'get-started/installation-problems/web-components.mdx', 'get-started/installation-problems/qwik.mdx', ]} />

Storybook collects completely anonymous data to help us improve user experience. Participation is optional, and you may opt-out if you'd not like to share any information.

If all else fails, try asking for help

Now that you installed Storybook successfully, let’s take a look at a story that was written for us.