Storybook

Build bulletproof UI components faster


Build Status on CircleCI CodeFactor Known Vulnerabilities codecov License
Storybook Community Backers on Open Collective Sponsors on Open Collective Official Twitter Handle

Storybook is a development environment for UI components. It allows you to browse a component library, view the different states of each component, and interactively develop and test components.

View README for:
latest next

## Intro Storybook runs outside of your app. This allows you to develop UI components in isolation, which can improve component reuse, testability, and development speed. You can build quickly without having to worry about application-specific dependencies. Here are some featured examples that you can reference to see how Storybook works: Storybook comes with a lot of [addons](https://storybook.js.org/docs/react/configure/storybook-addons) for component design, documentation, testing, interactivity, and so on. Storybook's API makes it possible to configure and extend in various ways. It has even been extended to support React Native development for mobile. ## Table of contents - 🚀 [Getting Started](#getting-started) - 📒 [Projects](#projects) - 🛠 [Supported Frameworks & Examples](#supported-frameworks) - 🚇[ Sub Projects](#sub-projects) - 🔗[Addons](#addons) - 🏅 [Badges & Presentation materials](#badges--presentation-materials) - 👥 [Community](#community) - 👏 [Contributing](#contributing) - 👨‍💻 [Development scripts](#development-scripts) - 💵 [Backers](#backers) - 💸 [Sponsors](#sponsors) - :memo: [License](#license) ## Getting Started First install storybook: ```sh cd my-react-app npx sb init ``` If you'd rather set up your project manually, take a look at our [Slow Start Guide](https://storybook.js.org/docs/react/configure/overview). Once it's installed, you can `npm run storybook` and it will run the development server on your local machine, and give you a URL to browse some sample stories. For full documentation on using Storybook visit: [storybook.js.org](https://storybook.js.org) For additional help, join us [in our Discord](https://discord.gg/sMFvFsG) or [Slack (legacy)](https://now-examples-slackin-rrirkqohko.now.sh/) ## Projects ### Supported Frameworks | Framework | Demo | | | ----------------------------------------------------------- | --------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------- | | [React](app/react) | [v6.0.x](https://storybookjs.netlify.com/official-storybook/?path=/story/*) | [![React](https://img.shields.io/npm/dm/@storybook/react.svg)](app/react) | | [React Native](https://github.com/storybookjs/react-native) | - | [![React Native](https://img.shields.io/npm/dm/@storybook/react-native.svg)](app/react-native) | | [Vue](app/vue) | [v6.0.x](https://storybookjs.netlify.com/vue-kitchen-sink/) | [![Vue](https://img.shields.io/npm/dm/@storybook/vue.svg)](app/vue) | | [Angular](app/angular) | [v6.0.x](https://storybookjs.netlify.com/angular-cli/) | [![Angular](https://img.shields.io/npm/dm/@storybook/angular.svg)](app/angular) | | [Marionette.js](app/marionette) | - | [![Marionette.js](https://img.shields.io/npm/dm/@storybook/marionette.svg)](app/marionette) | | [Mithril](app/mithril) | [v6.0.x](https://storybookjs.netlify.com/mithril-kitchen-sink/) | [![Mithril](https://img.shields.io/npm/dm/@storybook/mithril.svg)](app/mithril) | | [Marko](app/marko) | [v6.0.x](https://storybookjs.netlify.com/marko-cli/) | [![Marko](https://img.shields.io/npm/dm/@storybook/marko.svg)](app/marko) | | [HTML](app/html) | [v6.0.x](https://storybookjs.netlify.com/html-kitchen-sink/) | [![HTML](https://img.shields.io/npm/dm/@storybook/html.svg)](app/html) | | [Svelte](app/svelte) | [v6.0.x](https://storybookjs.netlify.com/svelte-kitchen-sink/) | [![Svelte](https://img.shields.io/npm/dm/@storybook/svelte.svg)](app/svelte) | | [Riot](app/riot) | [v6.0.x](https://storybookjs.netlify.com/riot-kitchen-sink/) | [![Riot](https://img.shields.io/npm/dm/@storybook/riot.svg)](app/riot) | | [Ember](app/ember) | [v6.0.x](https://storybookjs.netlify.com/ember-cli/) | [![Ember](https://img.shields.io/npm/dm/@storybook/ember.svg)](app/ember) | | [Preact](app/preact) | [v6.0.x](https://storybookjs.netlify.com/preact-kitchen-sink/) | [![Preact](https://img.shields.io/npm/dm/@storybook/preact.svg)](app/preact) | | [Rax](app/rax) | [v6.0.x](https://storybookjs.netlify.com/rax-kitchen-sink/) | [![Rax](https://img.shields.io/npm/dm/@storybook/rax.svg)](app/rax) | ### Sub Projects - [CLI](lib/cli) - Streamlined installation for a variety of app types - [examples](examples) - Code examples to illustrate different Storybook use cases ### Addons | Addons | | | ------------------------------------------- | -------------------------------------------------------------------------- | | [a11y](addons/a11y/) | Test components for user accessibility in Storybook | | [actions](addons/actions/) | Log actions as users interact with components in the Storybook UI | | [backgrounds](addons/backgrounds/) | Let users choose backgrounds in the Storybook UI | | [cssresources](addons/cssresources/) | Dynamically add/remove css resources to the component iframe | | [design assets](addons/design-assets/) | View images, videos, weblinks alongside your story | | [docs](addons/docs/) | Add high quality documentation to your components | | [events](addons/events/) | Interactively fire events to components that respond to EventEmitter | | [google-analytics](addons/google-analytics) | Reports google analytics on stories | | [graphql](addons/graphql/) | Query a GraphQL server within Storybook stories | | [jest](addons/jest/) | View the results of components' unit tests in Storybook | | [knobs](addons/knobs/) | Interactively edit component prop data in the Storybook UI | | [links](addons/links/) | Create links between stories | | [query params](addons/queryparams/) | Mock query params | | [storyshots](addons/storyshots/) | Snapshot testing for components in Storybook | | [storysource](addons/storysource/) | View the code of your stories within the Storybook UI | | [viewport](addons/viewport/) | Change display sizes and layouts for responsive components using Storybook | See [Addon / Framework Support Table](ADDONS_SUPPORT.md) ### Deprecated Addons | Addons | | | ---------------------------------------------------------------------------------- | -------------------------------------------------------- | | [info](https://github.com/storybookjs/deprecated-addons/tree/master/addons/info) | Annotate stories with extra component usage information | | [notes](https://github.com/storybookjs/deprecated-addons/tree/master/addons/notes) | Annotate Storybook stories with notes | | [contexts](https://github.com/storybookjs/storybook/tree/master/addons/contexts) | Addon for driving your components under dynamic contexts | | [options](https://github.com/storybookjs/storybook/tree/master/addons/options/) | Customize the Storybook UI in code | In order to continue improving your experience, we have to eventually deprecate certain addons in favor of new, better tools. If you're using info/notes, we highly recommend you to migrate to [docs](addons/docs/) instead, and [here is a guide](addons/docs/docs/recipes.md#migrating-from-notesinfo-addons) to help you. If you're using contexts, we highly recommend you to migrate to [toolbars](https://github.com/storybookjs/storybook/tree/next/addons/toolbars) and [here is a guide](https://github.com/storybookjs/storybook/blob/next/MIGRATION.md#deprecated-addon-contexts) to help you. ## Badges & Presentation materials We have a badge! Link it to your live Storybook example. ![Storybook](https://cdn.jsdelivr.net/gh/storybookjs/brand@master/badge/badge-storybook.svg) ```md [![Storybook](https://cdn.jsdelivr.net/gh/storybookjs/brand@master/badge/badge-storybook.svg)](link to site) ``` If you're looking for material to use in your presentation about storybook, like logo's video material and the colors we use etc, you can find all of that at our [brand repo](https://github.com/storybookjs/brand). ## Community - Tweeting via [@storybookjs](https://twitter.com/storybookjs) - Blogging at [Medium](https://medium.com/storybookjs) - Chatting on [Discord](https://discord.gg/sMFvFsG) - Chatting (legacy) on [Slack](https://now-examples-slackin-rrirkqohko.now.sh/) - Streaming saved at [Youtube](https://www.youtube.com/channel/UCr7Quur3eIyA_oe8FNYexfg) ## Contributing We welcome contributions to Storybook! - 📥 Pull requests and 🌟 Stars are always welcome. - Read our [contributing guide](CONTRIBUTING.md) to get started, or find us on [Discord](https://discord.gg/sMFvFsG), we will take the time to guide you Looking for a first issue to tackle? - We tag issues with [![Good First Issue](https://img.shields.io/github/issues/storybookjs/storybook/good%20first%20issue.svg)](https://github.com/storybookjs/storybook/issues?q=is%3Aopen+is%3Aissue+label%3A%22good+first+issue%22) when we think they are well suited for people who are new to the codebase or OSS in general. - [Talk to us](https://discord.gg/sMFvFsG), we'll find something to suits your skills and learning interest. ### Development scripts Storybook is organized as a monorepo using [Lerna](https://lerna.js.org/). Useful scripts include: #### `yarn bootstrap` > Installs package dependencies and links packages together - using lerna #### `yarn lint` > boolean check if code conforms to linting rules - uses remark & eslint - `yarn lint:js` - will check js - `yarn lint:md` - will check markdown + code samples - `yarn lint:js --fix` - will automatically fix js #### `yarn test` > boolean check if unit tests all pass - uses jest - `yarn run test --core --watch` - will run core tests in watch-mode ### Sponsors Become a sponsor and get your logo on our README on Github with a link to your site. \[[Become a sponsor](https://opencollective.com/storybook#sponsor)] ### Backers Support us with a monthly donation and help us continue our activities. \[[Become a backer](https://opencollective.com/storybook#backer)] ## License [MIT](https://github.com/storybookjs/storybook/blob/master/LICENSE) -the end-