11# Turn Figma designs into code | Codex use cases---
2name: Turn Figma designs into code
3tagline: Turn Figma selections into polished UI with structured design context
4 and visual checks.
5summary: Use Codex to pull design context, assets, and variants from Figma,
6 translate them into code that matches the repo's design system, then use
7 Playwright to compare the implementation to the Figma reference and iterate
8 until it looks right.
9skills:
10 - token: figma
11 url: https://github.com/openai/plugins/tree/main/plugins/figma
12 description: Implement designs in code, create Code Connect mappings between
13 published components and source files, and generate project-specific
14 design system rules for repeatable Figma-to-code work.
15 - token: $playwright
16 url: https://github.com/openai/skills/tree/main/skills/.curated/playwright-interactive
17 description: Check responsive behavior and verify the implemented UI in a real browser.
18bestFor:
19 - Implementing already designed screens or flows from Figma in an existing
20 codebase
21 - Teams that want Codex to work from structured design context
22starterPrompt:
23 title: Implement a Design System-Aware UI
24 body: >-
25 Implement this Figma design in the current project using the Figma skill.
2 26
3Need
4 27
528Design source Requirements:
6 29
730Default options - Start with `get_design_context` for the exact node or frame.
8 31
932[Figma](https://www.figma.com/) - If the response is truncated, use `get_metadata` to map the file and then
33 re-fetch only the needed nodes with `get_design_context`.
10 34
1135Why it's needed - Run `get_screenshot` for the exact variant before you start coding.
12 36
1337A concrete frame or component selection keeps the implementation grounded. - Reuse the existing design system components and tokens.
38
39 - Translate the Figma output into this repo's utilities and component
40 patterns instead of inventing a parallel system.
41
42 - Match spacing, layout, hierarchy, and responsive behavior closely.
43
44 - Respect the repo's routing, state, and data-fetch patterns.
45
46 - Make the page responsive on desktop and mobile.
47
48 - If Figma returns localhost image or SVG sources, use them directly and do
49 not create placeholders or add new icon packages.
50
51
52 Validation:
53
54 - Compare the finished UI against the Figma reference for both look and
55 behavior.
56
57 - Use Playwright to check that the UI matches the reference and iterate as
58 needed until it does.
59 suggestedEffort: medium
60relatedLinks:
61 - label: Codex skills
62 url: /codex/skills
63 - label: Model Context Protocol
64 url: /codex/mcp
65techStack:
66 - need: Design source
67 goodDefault: "[Figma](https://www.figma.com/)"
68 why: A concrete frame or component selection keeps the implementation grounded.
69---
70
71## Introduction
72
73When you have an exact Figma selection, Codex can turn it into polished UI without ignoring the patterns already established in your project.
74
75With the Figma skill, Codex can use the Figma MCP server to pull structured design context, variables, assets, and the exact variant it should implement.
76
77With the Playwright interactive skill, Codex can open the app in a real browser, compare the implementation to the Figma reference, and iterate on layout or behavior until the result is closer to the target.
78
79## Set up your Figma project
80
81The cleaner your Figma file is, the better the first implementation will be. To improve the handoff:
82
83- Use variables or design tokens wherever possible, especially for colors, typography, and spacing
84- Create components for reusable UI elements instead of repeating detached layers
85- Use auto layout as much as possible instead of manual positioning
86- Keep frame and layer names clear enough that the main screen, state, and variants are obvious
87- Keep real icons and images in the file when possible so Codex does not need to guess
88
89This gives Codex better structure to translate into a robust, production-ready UI.
90
91## Be specific
92
93The more specific you are about the expected interaction patterns and the style you want, the better the result will be.
94
95If a state, breakpoint, or interaction matters, call it out. If the file contains multiple close variants, tell Codex which one should be treated as the source of truth.
96
97The more explicit you are about what needs to match exactly and where repo conventions should win, the easier it is for Codex to make the right tradeoffs.
98
99## Prepare the design system
100
101Codex works best when the target repo already has a clear component layer. Codex can automatically use your existing component and design system instead of recreating them from scratch.
102
103If you think it's necessary, specify to Codex which primitives to reuse, where your tokens live, and what the repo considers canonical for buttons, inputs, cards, typography, and icons.
104
105Treat the Figma MCP output, which often looks like React plus Tailwind, as a structural reference rather than final code style. Ask Codex to translate that output into the project's actual utilities, component wrappers, color system, typography scale, spacing tokens, routing, state management, and data-fetch patterns.
106
107## Workflow
108
109### Start from a Figma selection
110
111Copy a link to the exact Figma frame, component, or variant you want implemented. The Figma MCP flow is link-based, so the link needs to point to the exact node you want rather than a nearby parent frame.
112
113### Prompt Codex to use Figma
114
115Figma should drive the first pass. Ask Codex to follow the Figma MCP flow before it starts implementing.
116
117Things to include in your prompt:
118
119Once the first implementation is in place, Codex will use Playwright to verify the UI in a real browser and tighten any remaining visual or interaction mismatches.