npm.io
7.2.5 • Published 3 years ago

@junk-temporary-prototypes/manager-api

Licence
MIT
Version
7.2.5
Deps
15
Size
168 kB
Vulns
0
Weekly
0
Stars
91.7K

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 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 React
Next.js Next.js
TanStack React TanStack React
React Native Web React Native Web
React Native React Native
Vue 3 Vue 3
Angular Angular
SvelteKit SvelteKit
Svelte Svelte
Web components Web components
Preact Preact
HTML HTML

The community maintains frameworks for other libraries, including:

Community framework Version Downloads
Astro Astro
Nuxt Nuxt
SolidJS 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 docs
a11y Test that your components are accessible a11y
links Create links between stories links
vitest Run your stories as tests in Vitest browser mode vitest
visual tests Catch unexpected visual changes in your stories using Chromatic visual tests
themes Switch your component library themes from the toolbar themes
msw Mock API requests in stories using Mock Service Worker msw
mcp Run a MCP server in your local Storybook mcp
designs Embed Figma files and other design previews alongside your story designs
pseudo-states Toggle CSS pseudo states such as :hover and :focus on your components pseudo-states
dark-mode Toggle between light and dark mode in Storybook dark-mode
tag-badges Display story tags as badges in the sidebar and toolbar tag-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-

Keywords