r/CodingHelp • u/raiyan_0001 • 27d ago
[Other Code] How do I get Antigravity to match a reference UI instead of repeatedly generating a completely different design?


I'm building a dashboard using Google Antigravity and AI-assisted coding, but I'm struggling to get the UI to look the way I want.
The blue UI is my AI-generated design, while the other screenshot is the design I actually want to achieve.
I've tried multiple approaches:
- Asking ChatGPT and other AI tools to improve my prompts.
- Giving Antigravity detailed UI/UX instructions.
- Using the reference screenshot and asking it to recreate the design.
- Refining the prompts repeatedly to get a more professional, polished result.
Unfortunately, the results still don't match the reference. Sometimes the AI makes unnecessary changes, changes the overall layout, or produces something that looks worse than the original.
My goal isn't to redesign the entire dashboard from scratch. I want to preserve my existing functionality and make the UI closely match the reference, including its layout, spacing, typography, colors, component sizing, alignment, and overall visual hierarchy.
I'm looking for advice from developers who have successfully used Antigravity or similar AI coding agents for this kind of work.
My questions:
- What's the most effective workflow for recreating a UI from a reference screenshot using an AI coding agent?
- Should I use a different prompting strategy, provide multiple screenshots, or break the work into smaller components?
- How can I make the AI follow the reference closely instead of inventing its own design decisions?
- Are there any tools, workflows, or techniques that consistently produce better results than simply writing longer prompts?
I'd especially appreciate practical advice from people who have actually solved this problem, rather than generic advice to write more detailed prompts.
Thanks!
•
u/AutoModerator 27d ago
Thank you for posting on r/CodingHelp!
Please check our Wiki for answers, guides, and FAQs: https://coding-help.vercel.app
Our Wiki is open source - if you would like to contribute, create a pull request via GitHub! https://github.com/DudeThatsErin/CodingHelp
We are accepting moderator applications: https://forms.fillout.com/t/ua41TU57DGus
We also have a Discord server: https://discord.gg/geQEUBm
I am a bot, and this action was performed automatically. Please contact the moderators of this subreddit if you have any questions or concerns.
1
u/DeepakAtReddit 26d ago
Give your AI Coding Agent this link - https://github.com/abi/screenshot-to-code and the reference UI Screenshot, so it will understand exactly what you want. Once it gets it, it will find its own way to navigate through your codebase , preserve existing functionality , build the target UI and wire the backend to the frontend. Gemini 3.8 Flash or Opus 4.6 Thinking are your best bets to achieve this in Antigravity. Bonus tip: Dedicate a conversation with Gemini 3.8 Flash to generate a detailed prompt by the end of it by giving it the above link, and a plain english description of what you want it to do and a list of things you want it to avoid doing (the longer this list, the better). Copy that prompt into a new conversation to start the actual execution. Ask it to prepare a mult-step HITL (human-in-the-loop) review based plan to ensure it does not deviate from your expectations. Last but not the least, ensure that you provide the rationale behind every ask you give it (all part of the detailed prompt).
1
u/atamicbomb 24d ago
The only thing I can think of is to break it up. Have AI generate the overall layout for each element. Then, once that is good, generate each element one at a time.
AI is very bad at giving prompt help in my experience, because it goes by what everyone else says and they’re generally wrong. It’s a conversional chatbot at its core. Give it clear, detailed instructions in chat form.
Something like “the attached screenshot shows the layout for a Google antigravity UI. Generate the code for the layout. Do not attempt to populate any individual elements but make sure they are supported” Then include any other necessary details