Skip to main content
Design to Code lets you skip the prompt entirely. Upload a screenshot, Figma export, or design mockup and ForgeAI will analyze it, extract a structured design specification, and hand that spec to the code agent — producing an implementation that closely matches your original design.
Design to Code is a Pro feature. Attempting to use screenshot upload without a Pro subscription returns a 403 error with { "error": "Pro is required" }.

How it works

1

Upload a design image

In the chat input, click the + button and select Attach file. You can attach a screenshot of a live website, a Figma export, or any design mockup saved as an image. Supported formats are standard image types (PNG, JPG, WebP).
2

Add an optional prompt

Type a short note describing what you want — for example, “Match this layout but use a dark theme” or “Convert this to a SaaS pricing page.” The note is passed to the extraction model as a hint.
3

Extraction runs automatically

ForgeAI uploads the image and sends it to gpt-4o-2024-08-06 with structured output enabled. The model analyzes the design and returns a DesignSpec JSON object that captures layout, theme, content, and media placeholders.
4

The code agent receives the spec

The extracted DesignSpec is prepended to your prompt and forwarded to the main code agent. The agent treats the spec as the primary source of truth for UI structure and copy, filling in only what’s necessary when details are ambiguous.
5

Your app is generated

Generation proceeds exactly as with a text-only prompt. The sandbox produces a Next.js app using Tailwind and Shadcn UI components that reflects the uploaded design.

What the extraction captures

The extraction model produces a DesignSpec with the following fields:

Theme

FieldDescription
primaryColorHexPrimary brand color, as a hex string
backgroundColorHexPage background color
textColorHexDefault text color
radiusBorder-radius scale — sm, md, lg, or xl
fontStyleTypography style — modern_sans, classic_sans, or serif

Pages and sections

Each page in the spec has a route and an array of sections. Every section includes:
  • type — the section’s role (e.g., hero, features, pricing, faq)
  • layout — container size (sm, md, lg), column count (1–6), and alignment (left or center)
  • content — heading, subheading, body text, CTA buttons with variants, and a list of repeated items
  • media — image placeholders with aspect ratio (square, video, or wide) and alt text

Uncertainties

When the model cannot confidently extract a value, it sets that field to null and records a note in meta.uncertainties. The code agent reads these notes and makes conservative assumptions where information is missing.

Supported inputs

  • Browser screenshots — captured directly from any website or app
  • Figma exports — PNG or JPG exports of frames or components
  • Design mockups — wireframes, high-fidelity comps, or any image that shows a UI layout
The extraction model works best with clean, full-page screenshots. Cropped or low-resolution images may result in more null fields and uncertain values, which the code agent will fill with sensible defaults.

Build docs developers (and LLMs) love