This package provides a CLI for adding Storybook to your project.
The quickest way to add Storybook to your project is to run this package via npx:
cd your-project-folder
npx storybook
That's all you've to do.
If you don't use npx install this CLI globally.
npm i -g storybook
Then go to your project's folder and run:
storybook
After that run Storybook by
npm run storybook
or
yarn storybook
For more information visit: storybook.js.org
Yarn support
It also supports yarn.
If you have installed yarn in your system, it'll detect it and use yarn
instead of npm
.
If you don't want to use yarn
always you can use the --use-npm
option like this:
storybook --use-npm
Flow support
It also supports flow files. By default, jscodeshift, the tool used to transform the source files, uses babel to read the files. To be able to transform any flow annotated file, you need to use the flow parser.
storybook --parser flow
npm package: https://www.npmjs.com/package/storybook
github repo: https://github.com/storybooks/storybook-package
Storybook monorepo: https://github.com/storybooks/storybook
in order to have the latest Storybook CLI install:
npm i -g @storybook/cli