Steve Kinney

Building Design Systems with Storybook

Setting Up Storybook

Storybook handles most of it’s own configuration. Inside of an existing projects, you just need to run the following command.

npx storybook@latest init

When you run this command, Storybook will take a look at your project and try to figure out what framework—if any—that you’re using along with what build tools you’re using. For the sake of argument, let’s say we’re using React, TypeScript, and Vite.

Storybook will install the following dependencies:

Additionally, eslint-plugin-storybook will be installed only if you’re already using ESLint in your project.

There is one additional dependency, @storybook/addon-onboarding, that will only be installed with certain frameworks. You’ll also most likely be removing it later.

It will also create .storybook directory at the root of your project with two files:

  • .storybook/main.ts
  • .storybook/preview.ts

It will set you up with some basic stories in src/stories.

Lastly, it will start up a server running on port 6006. You can start this server up at any time using npm run storybook.

Storybook's initial welcome screen

With that, let’s take a look at writing our first story.

Last modified on .