1# Build responsive front-end designs | Codex use cases1---
2name: Build responsive front-end designs
3tagline: Turn screenshots and visual references into responsive UI with visual checks.
4summary: Use Codex to translate screenshots and design briefs into code that
5 matches the repo's design system, then use Playwright to compare the
6 implementation to your references for different screen sizes and iterate until
7 it looks right.
8featured: true
9skills:
10 - token: $playwright
11 url: https://github.com/openai/skills/tree/main/skills/.curated/playwright-interactive
12 description: Open the app in a real browser to verify the implementation and
13 iterate on layout and behavior.
14bestFor:
15 - Creating new front-end projects from scratch
16 - Implementing already designed screens or flows from screenshots in an
17 existing codebase
18starterPrompt:
19 body: >-
20 Implement this UI in the current project using the screenshots and notes I
21 provide as the source of truth.
2 22
3Codex use cases
4 23
524 Requirements:
6 25
726 - Reuse the existing design system components and tokens.
8 27
9Codex use case28 - Translate the screenshots into this repo's utilities and component
29 patterns instead of inventing a parallel system.
10 30
11# Build responsive front-end designs31 - Match spacing, layout, hierarchy, and responsive behavior closely.
12 32
13Turn screenshots and visual references into responsive UI with visual checks.33 - Respect the repo's routing, state, and data-fetch patterns.
14 34
15Difficulty **Intermediate**35 - Make the page responsive on desktop and mobile.
16 36
17Time horizon **1h**37 - If any screenshot detail is ambiguous, choose the simplest implementation
38 that still matches the overall direction and note the assumption briefly.
18 39
19Use Codex to translate screenshots and design briefs into code that matches the repo's design system, then use Playwright to compare the implementation to your references for different screen sizes and iterate until it looks right.
20 40
21## Best for41 Validation:
22 42
23- Creating new front-end projects from scratch43 - Compare the finished UI against the provided screenshots for both look and
24- Implementing already designed screens or flows from screenshots in an existing codebase44 behavior.
25 45
26# Contents46 - Use $playwright-interactive to check that the UI matches the references
27 47 and iterate as needed until it does.
28[← All use cases](https://developers.openai.com/codex/use-cases)48 suggestedEffort: medium
29 49relatedLinks:
30Copy page [Export as PDF](https://developers.openai.com/codex/use-cases/frontend-designs/?export=pdf)50 - label: Codex skills
31 51 url: /codex/skills
32Use Codex to translate screenshots and design briefs into code that matches the repo's design system, then use Playwright to compare the implementation to your references for different screen sizes and iterate until it looks right.52---
33
34Intermediate
35
361h
37
38Related links
39
40[Codex skills](https://developers.openai.com/codex/skills)
41
42## Best for
43
44- Creating new front-end projects from scratch
45- Implementing already designed screens or flows from screenshots in an existing codebase
46
47## Skills & Plugins
48
49- [Playwright](https://github.com/openai/skills/tree/main/skills/.curated/playwright-interactive)
50
51 Open the app in a real browser to verify the implementation and iterate on layout and behavior.
52
53| Skill | Why use it |
54| --- | --- |
55| [Playwright](https://github.com/openai/skills/tree/main/skills/.curated/playwright-interactive) | Open the app in a real browser to verify the implementation and iterate on layout and behavior. |
56
57## Starter prompt
58
59Implement this UI in the current project using the screenshots and notes I provide as the source of truth.
60Requirements:
61- Reuse the existing design system components and tokens.
62- Translate the screenshots into this repo's utilities and component patterns instead of inventing a parallel system.
63- Match spacing, layout, hierarchy, and responsive behavior closely.
64- Respect the repo's routing, state, and data-fetch patterns.
65- Make the page responsive on desktop and mobile.
66- If any screenshot detail is ambiguous, choose the simplest implementation that still matches the overall direction and note the assumption briefly.
67Validation:
68- Compare the finished UI against the provided screenshots for both look and behavior.
69- Use $playwright-interactive to check that the UI matches the references and iterate as needed until it does.
70
71Open in the Codex app
72
73Implement this UI in the current project using the screenshots and notes I provide as the source of truth.
74Requirements:
75- Reuse the existing design system components and tokens.
76- Translate the screenshots into this repo's utilities and component patterns instead of inventing a parallel system.
77- Match spacing, layout, hierarchy, and responsive behavior closely.
78- Respect the repo's routing, state, and data-fetch patterns.
79- Make the page responsive on desktop and mobile.
80- If any screenshot detail is ambiguous, choose the simplest implementation that still matches the overall direction and note the assumption briefly.
81Validation:
82- Compare the finished UI against the provided screenshots for both look and behavior.
83- Use $playwright-interactive to check that the UI matches the references and iterate as needed until it does.
84 53
85## Introduction54## Introduction
86 55
97## Be specific66## Be specific
98 67
99The more specific you are about the expected interaction patterns and the style you want, the better the result will be.68The more specific you are about the expected interaction patterns and the style you want, the better the result will be.
100The model tends to default to high-frequency patterns and style so if it’s not obvious from your references that you want something else, the UI might look generic.69The model tends to default to high-frequency patterns and style so if it's not obvious from your references that you want something else, the UI might look generic.
101The more input you give, be it more reference inspiration or more specific instructions, the more you can expect to have a UI that stands out.70The more input you give, be it more reference inspiration or more specific instructions, the more you can expect to have a UI that stands out.
102 71
103## Prepare the design system72## Prepare the design system
104 73
105Codex 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.74Codex 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.
106 75
107If you think it’s necessary (i.e. if you’re not using a standard stack), specify to Codex which primitives to reuse, where your tokens live, and what the repo considers canonical for buttons, inputs, cards, typography, and icons.76If you think it's necessary (i.e. if you're not using a standard stack), specify to Codex which primitives to reuse, where your tokens live, and what the repo considers canonical for buttons, inputs, cards, typography, and icons.
108 77
109If you’re starting from an existing codebase, it’s very likely that Codex will understand on its own how to use your components and design system, but if starting from scratch, it’s a good idea to be explicit.78If you're starting from an existing codebase, it's very likely that Codex will understand on its own how to use your components and design system, but if starting from scratch, it's a good idea to be explicit.
110 79
111Ask Codex to treat the screenshots as a visual target but to translate that target into the project’s actual utilities, component wrappers, color system, typography scale, spacing tokens, routing, state management, and data-fetch patterns.80Ask Codex to treat the screenshots as a visual target but to translate that target into the project's actual utilities, component wrappers, color system, typography scale, spacing tokens, routing, state management, and data-fetch patterns.
112 81
113## Leverage Playwright82## Leverage Playwright
114 83
122 91
123The first pass should already be directionally close to the screenshots. For complex layouts, interactions, or animation-heavy UI, expect a few rounds of adjustment.92The first pass should already be directionally close to the screenshots. For complex layouts, interactions, or animation-heavy UI, expect a few rounds of adjustment.
124 93
125Ask Codex to compare the implementation back to the screenshots, not just whether the page builds. When conflicts come up, it should prefer the repo’s design-system tokens and only make minimal spacing or sizing adjustments needed to preserve the overall look of the design.94Ask Codex to compare the implementation back to the screenshots, not just whether the page builds. When conflicts come up, it should prefer the repo's design-system tokens and only make minimal spacing or sizing adjustments needed to preserve the overall look of the design.
126 95
127Use additional screenshots or short notes if they help clarify states that are not obvious from one image.96Use additional screenshots or short notes if they help clarify states that are not obvious from one image.
128 97
129### Suggested follow-up prompt98### Suggested follow-up prompt
130
131[current implementation image] [reference image]
132This doesn't look right. Make sure to implement something that matches closely the reference:
133[if needed, specify what is different]
134
135## Related use cases
136
137[
138
139### Get from idea to proof of concept
140
141Use Codex with ImageGen to turn a rough idea into a visual direction, implement the smallest...
142
143Front-end Engineering](https://developers.openai.com/codex/use-cases/idea-to-proof-of-concept)[
144
145### Turn Figma designs into code
146
147Use Codex to pull design context, assets, and variants from Figma, translate them into code...
148
149Front-end Design](https://developers.openai.com/codex/use-cases/figma-designs-to-code)[
150
151### Make granular UI changes
152
153Use Codex to make one small UI adjustment at a time in an existing app, verify it in the...
154
155Front-end Design](https://developers.openai.com/codex/use-cases/make-granular-ui-changes)
156