Figma to Code: How to Turn Designs Into a Working App
The ways to get from a Figma design to real code: hand-building from Dev Mode, Figma's own code features, plugins, AI tools that read Figma via MCP or screenshots, and AI app builders. What each produces, and how to prepare a Figma file so the result is actually usable.
You have a design in Figma. You want it to be a working website or app. There's no magic button that produces production-ready code for a real app — but the options have improved a lot, especially with AI.
What "code" means here
Turning a design into code involves several different things:
- Layout and styling — the visual result (HTML/CSS, React + Tailwind).
- Components — reusable buttons, cards, inputs.
- Behaviour — what happens on click, form validation, loading states.
- Data — real content from a database or API.
Design-to-code tools mostly help with 1 and 2. Behaviour and data still have to be built. (Frontend vs backend)
Option 1: build it by hand with Dev Mode
Figma's Dev Mode shows developers measurements, colours, fonts, spacing and CSS snippets for any element. A developer (or you) builds the components using those values.
Pros: clean code that fits your project. Cons: slowest.
Option 2: AI coding tools reading the design
Modern AI coding tools can work from a design directly:
- Screenshots — paste an image of the Figma frame and ask for the component. Works with Claude Code, Cursor and most AI tools. (Paste screenshots into Claude Code)
- Figma's MCP server — lets AI tools read the actual design data (layers, styles, components, variables) rather than guessing from pixels, so spacing and colours come out more accurate. (What is MCP?, The best MCP servers)
A good prompt:
Build this Figma frame as a React component using Tailwind and our existing Button and Card components from src/components/ui. Match spacing and colours exactly. Make it responsive: stack the cards on mobile.
Pros: fast, uses your existing components and conventions. Cons: needs review; results depend on how tidy the Figma file is.
Option 3: AI app builders
Tools like v0, Lovable and Bolt can take a screenshot or a Figma import and produce a working front-end app, often with shadcn/ui and Tailwind. (Lovable vs Bolt vs v0, What is shadcn/ui?)
Pros: fastest path to something clickable. Cons: you inherit their structure; you'll still connect real data and logic.
Option 4: export plugins and visual builders
Figma plugins (and tools like Framer or Webflow) can turn designs into code or a live site. Good for marketing pages; output for complex apps is often hard to maintain.
Prepare the Figma file — it matters most
Whatever tool you use, a well-built Figma file produces much better code:
- Use Auto Layout. It maps directly to Flexbox. Absolutely positioned layers produce absolutely positioned code. (Flexbox vs Grid)
- Name your layers ("PricingCard", not "Frame 47").
- Use components and variants for repeated elements.
- Use styles/variables for colours, type and spacing — these become your design tokens or Tailwind theme.
- Design mobile and desktop versions, or at least show how things reflow. (Responsive design basics)
- Include states — hover, disabled, loading, empty, error.
Then review like a developer
Check the generated code for:
- Real, semantic HTML (buttons are
<button>s). (Semantic HTML) - Accessibility — labels, alt text, contrast. (Accessibility basics)
- Hardcoded sizes that break on other screens.
- Duplicated styles that should be components.
The realistic workflow
- Design key screens in Figma with Auto Layout and components.
- Set up the project's theme from the Figma variables.
- Use an AI tool with the Figma MCP server or screenshots to build components one at a time.
- Wire up data and behaviour.
- Compare against the design in the browser and fix the differences.
EasySpawn gives Claude Code a live preview of your app on its own server — feed it your Figma frames and compare the result side by side as it builds. See how it works or join the waitlist.
Related: What Is a Wireframe? · What Is Tailwind CSS? · What Is shadcn/ui? · The Best MCP Servers for Coding
Keep reading
How to Write a Product Requirements Document (PRD) — With AI's Help
A PRD says what you're building, for whom, and how you'll know it works — before anyone writes code. What goes in a good one, a short template, how to use AI to draft and pressure-test it, and why a clear PRD is the best input you can give an AI coding tool.
"ReferenceError: window is not defined" in Next.js: How to Fix It
window, document and localStorage only exist in the browser. Next.js renders components on the server first, where they don't exist. Why it happens, and the fixes: useEffect, 'use client', typeof checks, dynamic imports with ssr: false, and libraries that touch window on import.