How Do You Turn a Design Into Code With Cursor?
Paste a screenshot or mockup into the Agent input and ask it to build the component, then have it check the result in Cursor's built-in browser. For fixes after that, Design Mode lets you click elements on your running app and leave notes, instead of describing them in words.
Build this design as a component in [path], using the attached image. Use existing components from @[UI library file] and our styling approach, [Tailwind / CSS modules]. Don't add new dependencies. Match layout, spacing and hierarchy. Where the image doesn't show a state, such as hover, loading or empty, ask me rather than inventing it. Then start or find the dev server, open [local URL] in the browser, take a screenshot, and list the differences you can see compared with the design.
- 1Paste the mockup
- 2Name components to reuse
- 3Check in the browser
- 4Fix with Design Mode notes
Try it now
- 1Drag a mockup into the Agent input, or paste a screenshot with Cmd+V, then send the prompt above.
- 2When it renders, open the browser in the Agents Window and click Annotate, or press Cmd+Shift+D with the browser focused.
- 3Click one element, type the change and press Return. It worked if the note goes to the agent and the right code changes. If you see a pen icon labeled Design Mode instead, your version is older than 3.24.18.
Use it when
Building a component from a mockup or Figma export, matching a visual bug, or doing a round of small UI changes on a working page. Design Mode is the better choice once the page runs and you're down to adjustments.
Skip it when
Pixel-exact work against a design system with strict tokens, unless the agent can read those tokens. Connect the Figma MCP server in that case, rather than asking it to estimate from an image. Design Mode also isn't available in the editor window, because it lives in the browser inside the Agents Window.
Why it works
Agent reads images directly on vision-capable models, so it can match a layout from a screenshot. The built-in browser closes the loop: it can navigate to the page, take a screenshot and compare, so you aren't passing images back and forth. Design Mode solves a different problem. UI requests are spatial, and "the card on the left" is vague. Cursor's docs say each note includes the details of what you picked plus a screenshot, so the agent can find the right code.
Example
Say you paste a pricing card mockup and ask for a PricingCard built on your existing Button. The first version is close, but the badge sits too low and two cards don't match. In Design Mode you click the badge and note "align with the title", then Shift-click both cards and write "make the second match the first". You turn on Batch edits so these collect as numbered pins, and click Send once.
Going further
Two Design Mode details save time. Double-click text to edit it in place, and note that text edits always wait for Send. On a single-element note, Edit CSS properties opens an inspector so you can send exact values rather than describing them. For true design data, Cursor's course suggests the Figma MCP server, so the agent can pull design tokens, variables and component specs directly. A possible trap: image types such as *.png and *.svg are on Cursor's default ignore list, so if a file in your repo won't attach, paste the image into the chat instead.
Common mistakes
- Pasting an image with no instruction about existing components, then getting a new parallel set of buttons and cards.
- Letting the agent invent hover and empty states rather than asking you what they should be.
- Writing a long description of a visual problem when one click in Design Mode would identify it.
- Forgetting pending notes. If you exit with notes still pending, Send stays in the toolbar until you send or clear them.
Sources
- Developing features, Cursor Learn
- Design Mode, Cursor Docs
- Browser, Cursor Docs
- Prompting agents, Cursor Docs
- Ignore file, Cursor Docs
- Cursor Agent, Cursor Docs
Checked 6 November 2026. Products change often, so confirm details with the vendor.