UNPKG

1.56 kBMarkdownView Raw
1# Storybook
2
3## CLI
4
5Storybook 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
9Go to your project and run:
10
11```sh
12cd my-app
13npx storybook@latest init
14```
15
16In 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
23See the command-line help with `-h` (including other useful commands) for details.
24
25## Core APIs
26
27This package has multiple sub-exports to can be used to gain access to storybook's APIs.
28
29### `storybook/components`
30
31This export contains a list of components very useful for building out addons.
32We 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
36This export exposes a few utility functions to help writing components that automatically adapt to the current theme.
37Useful for addon authors who want to make their addons theme-aware.
38
39### `storybook/preview-api`
40
41This export contains the API that is available in the preview iframe.
42
43### `storybook/manager-api`
44
45This export contains the API that is available in the manager iframe.
46
47### `storybook/types`
48
49This export exposes a lot of TypeScript interfaces used throughout storybook, including for storybook configuration, addons etc.