Build, test & document components
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
- 🤖 AI
- 📒 Projects
- 👥 Community
- 👏 Contributing
- 👨💻 Development scripts
- 💸 Sponsors
- 💵 Backers
- 🏅 Badges & Presentation materials
- 📝 License
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 list | List all components and docs entries |
storybook tools docs show | Show the props and usage examples of a component |
storybook tools stories changed | List the stories that are new, modified, or affected by uncommitted changes |
storybook tools test run | Run story tests, with accessibility checks if set up |
storybook tools review create | Publish 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
| Framework | Version | Downloads |
|---|---|---|
| React | ||
| Next.js | ||
| TanStack React | ||
| React Native Web | ||
| React Native | ||
| Vue 3 | ||
| Angular | ||
| SvelteKit | ||
| Svelte | ||
| Web components | ||
| Preact | ||
| HTML |
The community maintains frameworks for other libraries, including:
| Community framework | Version | Downloads |
|---|---|---|
| Astro | ||
| Nuxt | ||
| SolidJS |
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>.
| Addons | Downloads | |
|---|---|---|
| docs | Add high quality documentation to your components | |
| a11y | Test that your components are accessible | |
| links | Create links between stories | |
| vitest | Run your stories as tests in Vitest browser mode | |
| visual tests | Catch unexpected visual changes in your stories using Chromatic | |
| themes | Switch your component library themes from the toolbar | |
| msw | Mock API requests in stories using Mock Service Worker | |
| mcp | Run a MCP server in your local Storybook | |
| designs | Embed Figma files and other design previews alongside your story | |
| pseudo-states | Toggle CSS pseudo states such as :hover and :focus on your components | |
| dark-mode | Toggle between light and dark mode in Storybook | |
| tag-badges | Display story tags as badges in the sidebar and toolbar |
Find more in the addon catalog, and see the Addon / Framework Support Table.
Community
- Getting help in the repo's GitHub Discussions
- Posting on Bluesky
- Blogging at storybook.js.org and Medium
- Chatting on Discord
- Videos and streams at YouTube
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
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 --watchyarn --cwd code build --watch storybook- lets you rebuild Storybook's core package in the background as you make changeyarn 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 tocode/) and automatically fix ityarn fmt:check- will check formatting - uses oxfmtyarn 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-modeyarn 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.
[](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
-the end-