Codex: Prototype a Dashboard From a Screenshot

Attach a UI screenshot and have Codex build it as a React + Vite + Tailwind TypeScript page, matching spacing and typography, with a README to run it.

  • 🤖 Codex
  • 🗂️ Coding

Last verified: write-up checked

Prompt by OpenAI · Original source (opens in a new tab)

Codex: Prototype a Dashboard From a Screenshot — prompt preview

The prompt

prompt
Create a new dashboard based on this image.

Constraints:
- Use react, vite, and tailwind. Write the code in typescript.
- Match spacing, typography, and layout as closely as possible.

Outputs:
- A new route/page that renders the UI
- Any small components needed
- README.md with instructions to run it locally

What it is

From the "Prototype from a screenshot" workflow in OpenAI's Codex prompting docs. You save the screenshot locally, start Codex, drag the image into the terminal, and follow up with this prompt. It separates constraints (stack, match spacing and typography) from expected outputs (a new route, small components, a README with run instructions), which gives Codex a clear definition of done.

Who it's for

  • Frontend developers turning mockups into code
  • Founders prototyping a UI quickly

Requirements

Requirements

  • OpenAI Codex (CLI, IDE extension or cloud)

أرفق لقطة شاشة لواجهة واطلب من Codex بناءها كصفحة React وVite وTailwind بلغة TypeScript تطابق المسافات والخطوط، مع ملف README لتشغيلها.

Examples

From the source

Prompt
prompt
Create a new dashboard based on this image.

Constraints:
- Use react, vite, and tailwind. Write the code in typescript.
- Match spacing, typography, and layout as closely as possible.

Outputs:
- A new route/page that renders the UI
- Any small components needed
- README.md with instructions to run it locally

Expected output: Exact prompt from OpenAI prompting docs.

Pros & cons

Pros

  • Pro:Turns a screenshot into a working UI prototype fast
  • Pro:Spells out stack and constraints so output fits your project

Cons

  • Con:Pixel accuracy still needs manual review

Tips

  • The source says the image gives visual requirements but you still must state implementation constraints (framework, routing, component style)
  • Describe behaviour the image doesn't show, such as hover states, validation rules or keyboard interactions
  • Ask Codex to run the dev server and tell you exactly where to look