Storybook

用于单独构建UI组件。适用于UI开发、测试和文档编制

README

Storybook

Build bulletproof UI components faster


Build Status on CircleCI 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. Find out more at https://storybook.js.org.

View README for:
latest next


Table of contents


- 📒 Projects
  - 🚇 Sub Projects
  - 🔗Addons
- 👥 Community
  - 👨‍💻 Development scripts
  - 💵 Backers
  - 💸 Sponsors
- :memo: License

Getting Started


Visit Storybook's website to learn more about Storybook, and to get started.

Documentation


Documentation can be found Storybook's docs site.

Examples


Here are some featured examples that you can reference to see how Storybook works:

Storybook comes with a lot of 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, Android, iOS, and Flutter development for mobile.

Community


For additional help, join us in the Storybook Discord.

Projects


Supported Frameworks


FrameworkDemo|
------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
[React](app/react)[v6.2.x](https://storybookjs.netlify.com/official-storybook/?path=/story/*)[![React](https://img.shields.io/npm/dm/@storybook/react.svg)](app/react)
[Vue](app/vue)[v6.2.x](https://storybookjs.netlify.com/vue-kitchen-sink/)[![Vue](https://img.shields.io/npm/dm/@storybook/vue.svg)](app/vue)
[Angular](app/angular)[v6.2.x](https://storybookjs.netlify.com/angular-cli/)[![Angular](https://img.shields.io/npm/dm/@storybook/angular.svg)](app/angular)
[Web[v6.2.x](https://storybookjs.netlify.com/web-components-kitchen-sink/)[![Svelte](https://img.shields.io/npm/dm/@storybook/web-components.svg)](app/web-components)
[React-[![React
[HTML](app/html)[v6.2.x](https://storybookjs.netlify.com/html-kitchen-sink/)[![HTML](https://img.shields.io/npm/dm/@storybook/html.svg)](app/html)
[Ember](app/ember)[v6.2.x](https://storybookjs.netlify.com/ember-cli/)[![Ember](https://img.shields.io/npm/dm/@storybook/ember.svg)](app/ember)
[Svelte](app/svelte)[v6.2.x](https://storybookjs.netlify.com/svelte-kitchen-sink/)[![Svelte](https://img.shields.io/npm/dm/@storybook/svelte.svg)](app/svelte)
[Preact](app/preact)[v6.2.x](https://storybookjs.netlify.com/preact-kitchen-sink/)[![Preact](https://img.shields.io/npm/dm/@storybook/preact.svg)](app/preact)
[Marionette.js](app/marionette)-[![Marionette.js](https://img.shields.io/npm/dm/@storybook/marionette.svg)](app/marionette)
[Mithril](app/mithril)[v6.2.x](https://storybookjs.netlify.com/mithril-kitchen-sink/)[![Mithril](https://img.shields.io/npm/dm/@storybook/mithril.svg)](app/mithril)
[Marko](app/marko)[v6.2.x](https://storybookjs.netlify.com/marko-cli/)[![Marko](https://img.shields.io/npm/dm/@storybook/marko.svg)](app/marko)
[Riot](app/riot)[v6.2.x](https://storybookjs.netlify.com/riot-kitchen-sink/)[![Riot](https://img.shields.io/npm/dm/@storybook/riot.svg)](app/riot)
[Rax](app/rax)[v6.2.x](https://storybookjs.netlify.com/rax-kitchen-sink/)[![Rax](https://img.shields.io/npm/dm/@storybook/rax.svg)](app/rax)
[Android,[v6.2.x](https://storybookjs.github.io/native/@storybook/native-flutter-example/index.html)[![Rax](https://img.shields.io/npm/dm/@storybook/native.svg)](https://github.com/storybookjs/native)

Sub Projects


- CLI - Streamlined installation for a variety of app types
- examples - Code examples to illustrate different Storybook use cases

Addons


Addons|
|---------------------------------------------------------------------------|----------------------------------------------------------------------------|
[a11y](addons/a11y/)Test
[actions](addons/actions/)Log
[backgrounds](addons/backgrounds/)Let
[cssresources](https://github.com/storybookjs/addon-cssresources)Dynamically
[designView
[docs](addons/docs/)Add
[events](https://github.com/storybookjs/addon-events)Interactively
[google-analytics](https://github.com/storybookjs/addon-google-analytics)Reports
[graphql](https://github.com/storybookjs/addon-graphql)Query
[jest](addons/jest/)View
[links](addons/links/)Create
[queryMock
[storyshots](addons/storyshots/)Snapshot
[storysource](addons/storysource/)View
[viewport](addons/viewport/)Change


Deprecated Addons


Addons|
--------------------------------------------------------------------------------------------------------------------------------------------|
[info](https://github.com/storybookjs/deprecated-addons/tree/master/addons/info)Annotate
[notes](https://github.com/storybookjs/deprecated-addons/tree/master/addons/notes)Annotate
[contexts](https://storybook.js.org/addons/@storybook/addon-contexts/)Addon
[options](https://www.npmjs.com/package/@storybook/addon-options)Customize
[knobs](https://github.com/storybookjs/addon-knobs)Interactively

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 instead, and here is a guide to help you.

If you're using contexts, we highly recommend you to migrate to toolbars and here is a guide to help you.

Badges & Presentation materials


We have a badge! Link it to your live Storybook example.

Storybook

  1. ```md [![Storybook](https://cdn.jsdelivr.net/gh/storybookjs/brand@master/badge/badge-storybook.svg)](link to site)
  2. ```

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.

Community


- Tweeting via @storybookjs
- Blogging at storybook.js.org and Medium
- Chatting on Discord
- Streaming saved at Youtube

Contributing


We welcome contributions to Storybook!

- 📥 Pull requests and 🌟 Stars are always welcome.
- Read our contributing guide to get started,
  or find us on Discord, we will take the time to guide you

Looking for a first issue to tackle?

- We tag issues with Good First Issue when we think they are well suited for people who are new to the codebase or OSS in general.
- Talk to us, we'll find something to suits your skills and learning interest.

Development scripts


Storybook is organized as a monorepo using Lerna. 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]


Backers


Support us with a monthly donation and help us continue our activities. \[Become a backer]


License



-the end-