Skip to main content

Convert any UI screenshot into production-ready React components

Project description

UIForge

Convert any UI screenshot into production-ready React components.

PyPI version Python 3.10+ CI License: MIT


Take a screenshot of any UI. Get a complete, runnable React project in seconds.

uiforge dashboard.png

Not this:

<div style="position:absolute;left:143px;top:492px;width:241px">
  <div>
    <div>

This:

<DashboardLayout>
  <Sidebar />
  <Topbar />
  <StatsGrid>
    <RevenueCard title="Total Revenue" value="$48,295" trend="+12%" />
    <OrdersCard title="Orders" value="1,429" trend="+8%" />
    <VisitorsCard title="Visitors" value="24.5k" trend="+3%" />
  </StatsGrid>
  <SalesChart />
  <RecentOrders />
</DashboardLayout>

Semantic, named, composable — ready to npm run dev.


Install

pip install uiforge-cli

Or try without installing:

uvx uiforge-cli dashboard.png

UIForge uses Claude's vision API. Set your key:

export ANTHROPIC_API_KEY=sk-ant-...

Get a free key at console.anthropic.com


Usage

uiforge dashboard.png                          # React + Vite (default)
uiforge dashboard.png --framework next         # Next.js
uiforge dashboard.png --output ./my-app        # custom output dir
uiforge dashboard.png --context "dark SaaS"   # hint for better results
uiforge dashboard.png --dry-run                # analyze only, no codegen

What you get

my-app/
├── src/
│   ├── Dashboard.tsx          ← main page, composes everything
│   ├── components/
│   │   ├── Sidebar.tsx        ← each component is its own file
│   │   ├── Topbar.tsx
│   │   ├── StatsGrid.tsx
│   │   ├── RevenueCard.tsx
│   │   ├── SalesChart.tsx     ← recharts, wired up
│   │   └── RecentOrders.tsx   ← real table with mock data
│   ├── lib/utils.ts           ← cn() helper
│   └── globals.css            ← colors extracted from your screenshot
├── package.json
├── tailwind.config.js         ← exact colors from the image
└── tsconfig.json
cd my-app && npm install && npm run dev

It runs.


How it works

UIForge runs a 3-step pipeline:

1 — Analyze

Claude Vision reads the screenshot and returns a structured component tree: names, types, hierarchy, Shadcn/UI matches, Lucide icon suggestions, and exact hex colors from the image.

2 — Generate

Each component is generated independently. UIForge instructs the model to use Tailwind classes only (no position: absolute), wire in Shadcn/UI primitives where detected, add Framer Motion hover animations, and include realistic placeholder data.

3 — Scaffold

A complete project is written to disk — package.json, tailwind.config.js with the extracted color palette, tsconfig.json, globals.css, and all component files.


Generated stack

Framework React 18 + TypeScript
Styling Tailwind CSS (colors from your screenshot)
Components Shadcn/UI
Icons Lucide React
Animation Framer Motion
Charts Recharts
Build Vite or Next.js

Why not the other tools?

Most tools UIForge
Output <div style="left:143px"> Tailwind classes
Structure One 1500-line file One file per component
Runs immediately No npm install && npm run dev
Component names Component1, Box3 Sidebar, StatsCard
Design tokens Ignored Colors wired into tailwind.config.js
Charts Static image Working Recharts component
Shadcn/UI Never Auto-detected and used

Roadmap

  • --dark — generate light + dark theme variants
  • --responsive — one screenshot → desktop + tablet + mobile
  • --vue / --svelte / --flutter output targets
  • URL input: uiforge https://dribbble.com/shots/...
  • Render validation — screenshot the output, compare to original, auto-fix
  • Storybook story generation
  • Figma token export

Contributing

Good first issues:

  • Vue 3 + Composition API output target
  • Better chart detection (pie, area, scatter)
  • --responsive flag implementation
  • Render validation loop
  • Test fixtures (screenshots + expected component trees)

See CONTRIBUTING.md for setup.


License

MIT

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

uiforge_cli-0.1.0.tar.gz (15.5 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

uiforge_cli-0.1.0-py3-none-any.whl (16.2 kB view details)

Uploaded Python 3

File details

Details for the file uiforge_cli-0.1.0.tar.gz.

File metadata

  • Download URL: uiforge_cli-0.1.0.tar.gz
  • Upload date:
  • Size: 15.5 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.14.4

File hashes

Hashes for uiforge_cli-0.1.0.tar.gz
Algorithm Hash digest
SHA256 0b486ba27582c7f133ebf4bfff03864599a3ef5bebdb5022c91cfd57d56bac98
MD5 b7011a82a3f8263651973fa04114c232
BLAKE2b-256 c84c955e01b4772e7fbbc50ca3dace2b8f1f08a26372e70ba95dedc6bcf193cd

See more details on using hashes here.

File details

Details for the file uiforge_cli-0.1.0-py3-none-any.whl.

File metadata

  • Download URL: uiforge_cli-0.1.0-py3-none-any.whl
  • Upload date:
  • Size: 16.2 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.14.4

File hashes

Hashes for uiforge_cli-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 5bc7d3a1b34effd5e5be734f26f212fccbe145858341ccae4ec76543bfcec674
MD5 ea1494d38c65050e63130fee856c33ad
BLAKE2b-256 81966a8bd17212c26f4137d593ad4673aa090307d74f70f68010d946e6ba6e2e

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page