1 | # Storybook
|
2 |
|
3 | ## CLI
|
4 |
|
5 | Storybook CLI (_Command Line Interface_) is the easiest way to add [Storybook](https://github.com/storybookjs/storybook) to your project.
|
6 |
|
7 | ![Screenshot](docs/getstorybook.png)
|
8 |
|
9 | Go to your project and run:
|
10 |
|
11 | ```sh
|
12 | cd my-app
|
13 | npx storybook@latest init
|
14 | ```
|
15 |
|
16 | In addition to `init`, the CLI also has other commands:
|
17 |
|
18 | - `add` - add an addon and register it
|
19 | - `info` - print out system information for bug reports
|
20 | - `upgrade` - upgrade to the latest version of Storybook (or a specific version)
|
21 | - `migrate` - run codemods to migrate your code
|
22 |
|
23 | See the command-line help with `-h` (including other useful commands) for details.
|
24 |
|
25 | ## Core APIs
|
26 |
|
27 | This package has multiple sub-exports to can be used to gain access to storybook's APIs.
|
28 |
|
29 | ### `storybook/components`
|
30 |
|
31 | This export contains a list of components very useful for building out addons.
|
32 | We recommend addon-authors to use these components to ensure a consistent look and feel, and to reduce the amount of code they need to write.
|
33 |
|
34 | ### `storybook/theming`
|
35 |
|
36 | This export exposes a few utility functions to help writing components that automatically adapt to the current theme.
|
37 | Useful for addon authors who want to make their addons theme-aware.
|
38 |
|
39 | ### `storybook/preview-api`
|
40 |
|
41 | This export contains the API that is available in the preview iframe.
|
42 |
|
43 | ### `storybook/manager-api`
|
44 |
|
45 | This export contains the API that is available in the manager iframe.
|
46 |
|
47 | ### `storybook/types`
|
48 |
|
49 | This export exposes a lot of TypeScript interfaces used throughout storybook, including for storybook configuration, addons etc.
|