Installing and configuring Storybook

The first step to using Storybook is installing the global command-line tool. It's installed as a global tool because it can be used with many projects at the same time, and it can be used to bootstrap new projects. Let's start with this first step:

npm install @storybook/cli -g

Once this installation is done, you have the command-line tool that's used to modify your package.json dependencies and generate boilerplate Storybook files. Let's assume that you've used create-react-app to create a new application. Change into your application directory, and use the Storybook command-line tool to add Storybook to your current project:

getstorybook

The getstorybook command does a number of things for you when ...

Get React 16 Tooling now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.