AI-powered Storybook story generator — works with any framework, any design system, any LLM provider
AI-powered Storybook story generator — works with any framework, any design system, any LLM provider
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.
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.
.stories.tsx file in
your repository, in your Storybook, ready for a pull request.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.
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.
| 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.
Two ways in. Pick one.
Run these three commands in your Storybook project. The first asks a few questions, installs itself, and writes everything it needs.
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 togetherThen 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.
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:
claude mcp add --transport http story-ui /mcp-remote/mcp --header "Authorization: Bearer "
…
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
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 testCommits 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:
cd /path/to/your-storybook-project
PORT=4001 node /path/to/story-ui/dist/mcp-server/index.jsMIT. See LICENSE.
No open issues yet, or sync has not completed.