Baike.dev
All toolsOnline toolsAI codingTrendingOpen sourceNewsSubmit
Log in
< Back to tools
S

story-ui

> 前端框架
Open source

AI-powered Storybook story generator — works with any framework, any design system, any LLM provider

194 stars0 likes2 views
WebsiteGitHub

About

AI-powered Storybook story generator — works with any framework, any design system, any LLM provider

Story UI

Design screens in your own design system, by describing them.

Story UI adds a workspace to the Storybook you already have. You type what you want — "a settings page with a sidebar and a sticky save bar" — and it writes a real Storybook story using the components your team actually ships. The result appears in Storybook's own preview, with your providers, your theme and your tokens. It is not a mockup and not a sandbox. It is a file in your repository that a developer can open, review and keep.


Why it exists

Design systems are full of components that nobody has time to assemble into real screens. So exploration happens in a design tool, in a vocabulary the code does not share, and every idea has to be rebuilt before anyone can judge it.

Story UI closes that gap from the other side.

  • It only uses what you have. Components are discovered from your project: the package's type declarations, your local source, and Storybook's own index. It cannot invent a component you do not own, and every prop is checked against that component's real type.
  • It composes, so you can judge. Buttons and cards in isolation tell you nothing. Whole screens do.
  • The output is real work. Every generation is a .stories.tsx file in your repository, in your Storybook, ready for a pull request.
  • It checks itself before you see it. Each story is rendered in a real browser and measured — content inside its box, nothing overlapping, nothing blank, nothing broken — and generated again if it fails. See How Story UI checks its own work.

Who it is for. Product designers who want to explore in the real system without waiting on engineering. Design system teams who want their components used correctly. Engineers who want a first draft that already imports the right things.


What you can do

Start from a blank page or pick up where you left off. Recent work shows live thumbnails of every story you have made.

Describe a screen and watch it build. The plan streams in as the model thinks, then the code, then the story appears in the preview the moment the file is written. Stop is the same button as Send.

Attach references. Text, up to five images, and files: a Markdown spec, a CSV of the rows a table should show, a PDF brief. Or dictate with the microphone.

Change things two ways.

Example What happens
Ask for a change "add a filters panel", "make this three columns" Goes back to the model as an edit of the existing file. You see exactly which lines moved.
Edit a property directly "use the secondary button variant" Click the element. No model involved: the inspector reads that component's real props and rewrites one attribute instantly.

See every change. The Changes view shows the diff against the previous version. Every version is kept, and any of them can be restored.

Hand it off. One click commits the story to a new git branch and can open a pull request. It never commits to the branch you are on.


Requirements

You need Why
Storybook 10 or newer (10.5.10+ recommended) Story UI lives inside it.
Node 20 or newer To run the tools.
A React + TypeScript design system An npm package or local source. Other frameworks get the classic panel — see Framework support.
An API key Anthropic, OpenAI or Google Gemini. One is enough.
Playwright (npx playwright install chromium) So Story UI can render and check its own work. Optional, strongly recommended.

Not sure what your project has? Install, then run npx story-ui check. It tells you what works and gives you the command for anything that does not.


Install

Two ways in. Pick one.

Standard install

Run these three commands in your Storybook project. The first asks a few questions, installs itself, and writes everything it needs.

bash
npx @tpitre/story-ui@latest init   # a few questions, then it sets itself up
npx story-ui check                 # confirms it works, names anything to fix
npm run storybook-with-ui          # starts Storybook and Story UI together

Then open Storybook and click Story UI in the toolbar. Type a request and press Enter.

That is the whole install. You do not need to install the package first — init does that for you.

Agentic install

If you use an AI coding assistant (Claude Code, Cursor, Copilot, or an agent in your terminal), it can do the whole install for you. You only need to tell it two things: which AI provider you have a key for, and the key itself.

1. Find your provider in this table.

Your key is from Say this to the assistant Where to get a key
Anthropic (Claude) claude console.anthropic.com
OpenAI (GPT) openai platform.openai.com
Google (Gemini) gemini aistudio.google.com

2. Paste this to your assistant, replacing the two marked lines with your own provider and key:

Install Story UI into this Storybook project.

Provider: claude            
Flags for agents and scripts

For CI or a setup script, where the key comes from a secret rather than being
typed. `"$ANTHROPIC_API_KEY"` here is shell syntax meaning "read the
`ANTHROPIC_API_KEY` environment variable" — if you are pasting a key by hand,
put the key itself in quotes instead.

```bash
npx story-ui init --yes \
  --provider claude --api-key "$ANTHROPIC_API_KEY" \
  --port 4001 \
  --import-path '@your-scope/ui' \
  --components-path ./src/components \
  --stories-path ./src/stories/generated \
  --json

…

json
{
  "mcpServers": {
    "story-ui": {
      "command": "npx",
      "args": ["@tpitre/story-ui", "mcp"],
      "env": { "STORY_UI_CWD": "/path/to/your/project" }
    }
  }
}

The stdio process finds the HTTP server through STORY_UI_HTTP_BASE_URL, or VITE_STORY_UI_PORT / STORY_UI_HTTP_PORT / PORT (default 4001).

Streamable HTTP (remote): POST /mcp-remote/mcp. In token mode the client sends the bearer header:

bash
claude mcp add --transport http story-ui /mcp-remote/mcp --header "Authorization: Bearer "

…

bash
bash
npm test                                        # vitest: pure functions, fixtures, route contracts
node bench/resolution.mjs --project ../your-storybook --import '@your/design-system'
node bench/fidelity.mjs --server http://localhost:4101 --storybook http://localhost:6101 --project ../test-storybooks/react-mantine
bench/durability.sh ../test-storybooks/carbon:4109:6109 ../test-storybooks/mui-material:4107:6107

…

bash
bash
git clone https://github.com/southleft/story-ui.git
cd story-ui
npm install
npm run build          # tsc, templates and the manager bundle into dist/
npm test

Commits follow Conventional Commits (npm run commit); releases and CHANGELOG.md are produced by semantic-release. See CONTRIBUTING.md.

To run the server against a project from source:

bash
cd /path/to/your-storybook-project
PORT=4001 node /path/to/story-ui/dist/mcp-server/index.js

License

MIT. See LICENSE.

Issues· 0 open

View all issuesOpen on GitHub

No open issues yet, or sync has not completed.

> Tags

TypeScriptaiangularcode-generationcomponent-library

No comments yet. Be the first to share.

> Details

PublishedAug 1, 2026
UpdatedSep 18, 2026
Category前端框架
PricingOpen source

> Related tools

R
React
用于构建用户界面的 JavaScript 库
V
Vue.js
渐进式 JavaScript 框架
N
Next.js
基于 React 的全栈 Web 框架