Skip to content

kevin-riveros/react-ui-gen

Repository files navigation

Screenshot 2026-04-22 at 10 56 33β€―PM

React UI Gen

Prompt β†’ Live React UI. Built with your design system. Rendered in your browser.

Describe what you want in plain English. Claude writes real React against any design system you plug in β€” public npm, private registry, or your own monorepo package. The preview renders in your browser as the agent types. No servers to spin up, no WebContainers to boot, no infra to maintain.


License: MIT Built with Claude Next.js React TypeScript Tailwind CSS Prisma pnpm


react-gen-ui-gift

Live demo Β· Plug in your design system Β· Design gallery Β· Report a bug



What it is

React UI Gen is a prototyping surface, not an IDE. You open it, pick a template, and describe the UI you want. Claude writes real React against your design system β€” the one your team actually uses, even if it lives on a private registry. The preview renders live in your browser as the agent writes.

You're not running your production app here. You're iterating on components β€” fast, in isolation, against the real design-system contract.


Why not v0, Bolt, or Lovable

Every other AI UI prototyper ships heavy runtime infra and a fixed stack. UI Gen does the opposite.

UI Gen v0 Bolt.new Lovable
Your own design system? βœ… Yes shadcn only (beta) ❌ No ❌ No
Preview compute 🌐 Browser ☁️ Server 🐳 WebContainer ☁️ Server
Open source πŸ“– MIT ❌ No Partial ❌ No
Private registry support πŸ”’ Yes ❌ No ❌ No ❌ No

The design system is a plug-in, not a hardcode. Point src/config/uigen.config.ts at Material UI, HeroUI, a private @your-scope/ds-core, or a monorepo workspace β€” no engine changes, no rebuild.



Screenshot 2026-04-22 at 9 23 40β€―PM

How it works

🌐 Browser-only preview

Babel standalone + @tailwindcss/browser + ESM import maps, rendered inside a srcdoc iframe. No per-user container, no WebContainer, no server-side preview compute. A hosted instance serves 1 user or 10,000 with the same footprint.

🎨 Your design system, not a fixed one

One config file (src/config/uigen.config.ts) points the engine at any DS β€” public npm, GitHub Packages, file: deps, pnpm link, or a monorepo workspace. Swap Material UI for HeroUI for @your-scope/ds-core without touching engine code.

πŸ§ͺ Built to prototype, not to run a project

Every session starts from an isolated template β€” not a blank create-next-app. The agent only sees the DS contract and the canvas, not 10k files of boilerplate. Every token goes into your components instead of Claude re-scaffolding Next.js on every turn. Short context, cheap sessions, fast iteration.

πŸ›‘οΈ Security by default

Tool use writes to an in-memory virtual filesystem, not your disk. The preview runs inside a browser iframe, not on your host. Private packages resolve inside that sandbox β€” nothing ever lands in your node_modules. A malicious skill or a prompt injection has no shell, no filesystem, nowhere to go.

πŸ€– A real agent loop

Tool use (Read / Write / Edit / Grep / Skill) over the virtual filesystem. Prompt caching trims long sessions; context compression via Haiku keeps them alive past the usual wall. DS-specific docs load on-demand through Skill, so the system prompt stays short.


Everything else in the box

  • πŸ–ΌοΈ Multimodal chat. Drop a screenshot, paste from clipboard, or attach from disk. Say "build this" next to a mock β€” Claude gets the image alongside your text, in the same turn.
  • 🎯 Visual inspector. Click any element in the preview. Its tag, classes, source file, and line attach to your next message β€” the agent edits the right thing, not the closest thing.
  • πŸ” File locks. Mark Navbar.tsx, Footer.tsx, or index.css as locked. The agent's Write / Edit tools refuse to touch them.
  • ⚑ Progressive rendering. Components appear in the preview as the agent writes them, not at the end of a batch response.
  • 🧩 Templates + project switcher. Start from Homepage, Dashboard, Profile, or a blank canvas seeded with your DS entry files. Jump between experiments from the header.
  • πŸ”— Share links. Publish a read-only /share/[projectId] URL for design review β€” full-screen preview with an "Open in editor" handoff.
  • πŸ“¦ Download as ZIP. Export the virtual filesystem with a generated package.json and a README explaining how to wire into Vite / Next.js / CRA.
  • βœ‚οΈ Split editor. Resizable three-panel layout β€” chat on the left, Preview ⇄ Code tabs on the right with a file tree and syntax highlighting.
  • πŸ§ͺ Mock fallback. Works without an API key β€” canned responses for demos and CI.

πŸš€ Quick start

Ships preloaded with a HeroUI + Netflix design system so you can prototype immediately.

pnpm install

Copy .env.example to .env and paste your Anthropic API key:

ANTHROPIC_API_KEY=sk-ant-...

πŸ”‘ Get a key at console.anthropic.com. No key? The app falls back to a mock provider so you can still click around.

pnpm dev

Open http://localhost:3000. That's it.


πŸ‘‰ Want to plug in your own design system? Read Prototype with your design system β†’ for the full tutorial (public npm, private registry, monorepo).


🎨 Design system gallery

Five ready-to-use configs live in src/config-examples/. Swap between them with a single cp -r.

Screenshot 2026-04-22 at 10 20 00β€―PM
HeroUI β€” Netflix
✨ cinematic dark + red
Screenshot 2026-04-22 at 10 20 39β€―PM
HeroUI β€” Airbnb
coral, warm neutrals
Screenshot 2026-04-22 at 10 23 06β€―PM
HeroUI β€” Uber
monochrome, clean
Material UI
public npm, CSS-in-JS
Vanilla Tailwind
React + Tailwind, no DS

πŸ“– Learn more

Want to peek under the hood? Start here.


πŸ› οΈ Tech stack


🀝 Contributing

Contributions welcome β€” especially new design-system configs in src/config-examples/. See CONTRIBUTING.md for setup and PR workflow.

πŸ’¬ Community

πŸ‘€ Author

Built by Kevin Riveros β€” GitHub Β· LinkedIn

πŸ“„ License

MIT Β© Kevin Riveros. See LICENSE.

Releases

No releases published

Packages

 
 
 

Contributors