検索に戻る

storybookjs/storybook

TypeScriptJavaScriptSvelte

Storybook is the industry standard workshop for building, documenting, and testing UI components in isolation

総合ランク
S
Star
91,758
Fork
10,597

最終コミットの鮮度

S

最終コミットから 1 日

直近のコミット頻度

S

週平均 482.8 コミット (直近4週)

Issue クローズ率

S

89% (13346/14919)

Issue 平均応答時間

S

平均 10 時間

ドキュメント充実度

S

README: あり / License: MIT License

リリース鮮度

S

v11.0.0-rc.1 (2 日前)

README

Storybook

Build, test & document components


License NPM downloads per week Join our Discord Storybook Community Follow Storybook on BlueSky Follow Storybook on X

Storybook lets you build UI components and pages in isolation, mock hard-to-reach edge cases as stories, and use stories as tests

Storybook is a frontend workshop for building UI components and pages in isolation. Thousands of teams use it for UI development, testing, and documentation. Find out more at storybook.js.org!

Table of contents

Getting Started

Run this command at the root of an existing project to install and configure Storybook:

npm create storybook@latest

Or paste this prompt into your agent:

Set up Storybook for me with npm create storybook@latest and follow its instructions precisely

Visit Storybook's website to learn more about Storybook, or follow the installation guide for other package managers and manual setup.

Documentation

Documentation can be found on Storybook's docs site. To learn Storybook step by step, follow the tutorials.

Examples

View the Storybook Showcase to see how leading teams use Storybook.

Use storybook.new to quickly create an example project in Stackblitz.

AI

Storybook makes building UI with agents faster, better and cheaper. Your agent reuses the components you already have, writes stories for what it builds, tests its work by running stories, and gives you a visual review to check the result.

Skills and the CLI

Run this command in the root of your project to install Storybook's skills:

npx storybook automigrate skills

Skills are short instruction files in your repository that tell your agent what to do at each step of a UI change. Most AI agents support skills. Your agent learns how to interact with Storybook by reading skill files, and then calls the storybook tools command to get work done:

Command
storybook tools docs listList all components and docs entries
storybook tools docs showShow the props and usage examples of a component
storybook tools stories changedList the stories that are new, modified, or affected by uncommitted changes
storybook tools test runRun story tests, with accessibility checks if set up
storybook tools review createPublish a review of the stories that a change affects

See Connect your agent to get started, and the CLI options for all the tools. If you want your agent to call Storybook through MCP tools instead of CLI commands, the MCP addon serves the same tools from your dev server.

These features are available for React, Next, TanStack, Vue, Angular, Svelte, Web Components and multiple community frameworks. Check the supported frameworks for more details.

Published Storybooks

When you publish your Storybook with Chromatic, Chromatic also publishes its MCP server, at your published Storybook's URL followed by /mcp:

https://<branch>--<app-id>.chromatic.com/mcp

Agents that connect to the MCP server can look up your components, with their props and usage examples, without running Storybook. This lets the teams that build with your design system reuse its components from their own repositories. Chromatic MCP hosting is entirely free. See Use a published Storybook and Chromatic's setup guide for more details.

Projects

Supported Frameworks

FrameworkVersionDownloads
ReactReact
Next.jsNext.js
TanStack ReactTanStack React
React Native WebReact Native Web
React NativeReact Native
Vue 3Vue 3
AngularAngular
SvelteKitSvelteKit
SvelteSvelte
Web componentsWeb components
PreactPreact
HTMLHTML

The community maintains frameworks for other libraries, including:

Community frameworkVersionDownloads
AstroAstro
NuxtNuxt
SolidJSSolidJS

See the frameworks documentation for requirements and setup instructions.

Addons

Addons extend Storybook with features for component design, documentation, testing, interactivity, and so on. Add one to your project with npx storybook add <package>.

AddonsDownloads
docsAdd high quality documentation to your componentsdocs
a11yTest that your components are accessiblea11y
linksCreate links between storieslinks
vitestRun your stories as tests in Vitest browser modevitest
visual testsCatch unexpected visual changes in your stories using Chromaticvisual tests
themesSwitch your component library themes from the toolbarthemes
mswMock API requests in stories using Mock Service Workermsw
mcpRun a MCP server in your local Storybookmcp
designsEmbed Figma files and other design previews alongside your storydesigns
pseudo-statesToggle CSS pseudo states such as :hover and :focus on your componentspseudo-states
dark-modeToggle between light and dark mode in Storybookdark-mode
tag-badgesDisplay story tags as badges in the sidebar and toolbartag-badges

Find more in the addon catalog, and see the Addon / Framework Support Table.

Community

Contributing

Contributions to Storybook are always welcome! 📥 Pull requests and 🌟 Stars and 🕵🏿 Issue reproductions help us out.

Read our contributing guide to get started, or find us on Discord, we will take the time to guide you. We have contributor office hours on Discord every Monday at 3PM CET.

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 that suits your skills and learning interests

Development scripts

Storybook is organized as a monorepo. Useful scripts include:

yarn

Installs dependencies

yarn task

Lets you compile the codebase, run tests, create a sandbox, etc

yarn storybook:ui

Runs Storybook's own Storybook with our UI components

  • yarn task compile - builds the whole monorepo, needed once before you build --watch
  • yarn --cwd code build --watch storybook - lets you rebuild Storybook's core package in the background as you make change
  • yarn storybook:ui - opens our Storybook and detects file changes made by the build script

yarn lint

boolean check if code conforms to linting rules - uses oxlint

  • yarn --cwd code lint:js:cmd <file> --fix - will lint one file (path relative to code/) and automatically fix it
  • yarn fmt:check - will check formatting - uses oxfmt
  • yarn fmt:write - will automatically fix formatting

yarn test

boolean check if unit tests all pass - uses vitest

  • yarn test:watch - will run unit tests in watch-mode
  • yarn storybook:vitest - will run the stories of Storybook's own UI as tests in watch-mode, through the Vitest addon

Sponsors

Become a sponsor to have your logo and website URL on our README on Github. Become a sponsor.

Backers

By making a recurring donation, you can support us and our work. Become a backer.

Badges & Presentation materials

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

Storybook

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

If you're looking for material to use in your Storybook presentation, such as logos, video material, and the colors we use, you can find it all on our brand repo.

License

MIT

-the end-

この情報は最新ではございません。キャッシュを利用しており、数時間前の情報の可能性がございます。