UNPKG

2.05 kBMarkdownView Raw
1# Storybook for React
2
3Storybook for React is a UI development environment for your React components.
4With it, you can visualize different states of your UI components and develop them interactively.
5
6![Storybook Screenshot](https://github.com/storybookjs/storybook/blob/master/media/storybook-intro.gif)
7
8Storybook runs outside of your app.
9So you can develop UI components in isolation without worrying about app specific dependencies and requirements.
10
11## Getting Started
12
13```sh
14cd my-react-app
15npx -p @storybook/cli sb init
16```
17
18For more information visit: [storybook.js.org](https://storybook.js.org)
19
20---
21
22Storybook also comes with a lot of [addons](https://storybook.js.org/docs/react/configure/storybook-addons) and a great API to customize as you wish.
23You can also build a [static version](https://storybook.js.org/docs/react/workflows/publish-storybook) of your storybook and deploy it anywhere you want.
24
25Here are some featured storybooks that you can reference to see how Storybook works:
26
27- [Demo of React Dates](http://airbnb.io/react-dates/) - [source](https://github.com/airbnb/react-dates)
28- [Demo of React Native Web](https://necolas.github.io/react-native-web/docs/) - [source](https://github.com/necolas/react-native-web)
29
30## Create React App
31
32Support for [Create React App](https://create-react-app.dev/) is handled by [`@storybook/preset-create-react-app`](https://github.com/storybookjs/presets/tree/master/packages/preset-create-react-app).
33
34This preset enables support for all Create React App features, including Sass/SCSS and TypeScript.
35
36## Typescript
37
38`@storybook/react` is now exporting its own types to use with Typescript.
39You don't need to have `@types/storybook__react` installed anymore if it was your case.
40But you probably also need to use types from `@types/node @types/react`.
41
42## Docs
43
44- [Basics](https://storybook.js.org/docs/react/get-started/introduction)
45- [Configurations](https://storybook.js.org/docs/react/configure/overview)
46- [Addons](https://storybook.js.org/docs/react/configure/storybook-addons)