Skip to main content

Gemini: UI Screenshot to Component Code

Convert any UI screenshot or mockup into responsive, accessible React, Vue, or HTML component code using Gemini vision, with proper ARIA and interactive states.

Fill in the placeholders

Edit the values, then copy your finished prompt.

Your Prompt
prompt.txt

                                

What this prompt does

This prompt converts a UI screenshot or mockup into a real [framework] component using Gemini's vision. It asks for ten things at once: a layout that matches the image, styling via [styling], full responsiveness across your [breakpoints], semantic HTML with ARIA, every interactive state, extracted color tokens, icons from [icon_library], TypeScript prop types, [variant_count] variants where the design implies them, and a Storybook story.

The structure works because it front-loads the boilerplate that's tedious to write by hand. By demanding ARIA, focus and hover states, and CSS variables up front, you skip the accessibility and theming cleanup that usually comes later. The [framework] and [styling] variables decide the entire output shape, [breakpoints] controls the responsive behavior, and [icon_library] tells the model which icon set to map glyphs to instead of inventing SVGs.

When to use it

  • You have a design mockup or screenshot and want a starting component, not pixel-by-pixel hand-coding
  • You're building dashboards or web apps and want semantic, accessible markup generated up front
  • You need consistent [breakpoints] applied so the component is responsive from the start
  • You want color tokens and CSS variables extracted from a design automatically
  • You need TypeScript prop types and a Storybook story scaffolded alongside the component
  • You want [variant_count] variants stubbed when the design clearly implies them

Example output

Expect a single [framework] component file styled with [styling], including semantic markup, ARIA attributes, hover/focus/active/disabled states, a token set of CSS variables for the extracted colors, mapped [icon_library] icons, typed props, the requested variants, and a Storybook story. If the design shows data, it includes a mock data structure, and it notes any ambiguities it had to interpret.

Pro tips

  • Feed a clean, full-resolution screenshot — vision models approximate pixels, so cramped or low-res images produce sloppy spacing
  • Match [framework] and [styling] to your real stack exactly; mixing them forces a rewrite
  • Always tighten spacing and accessibility by hand afterward — generated ARIA and gaps are a strong draft, not final
  • Set [icon_library] to what you already use so it maps to real, importable icons instead of guessing
  • Use [variant_count] conservatively; ask for variants only when the design genuinely shows them, or you'll get speculative props
  • Verify the extracted color tokens against your design system rather than trusting eyeballed hex values

Frequently Asked Questions

Which frameworks and styling approaches does this support?
You control both with the `[framework]` and `[styling]` variables, so it can target React with TypeScript, Vue, or plain HTML, styled with Tailwind, CSS modules, or others. Match them to your actual stack, because a mismatch forces you to rewrite the output.
How accurate is the layout compared to my screenshot?
It matches layout and spacing as closely as a vision model can, but it approximates pixels rather than measuring them. Plan to tighten spacing, alignment, and accessibility by hand afterward, especially on dense or detailed designs.
Does it actually add accessibility attributes?
Yes, the prompt requires semantic HTML, ARIA attributes, and all interactive states like hover, focus, active, and disabled. Treat the generated accessibility as a solid draft and still test it with a keyboard and screen reader before shipping.
What happens with icons in the screenshot?
It maps icons to the `[icon_library]` you specify, identifying the closest matches rather than generating custom SVGs. Setting this to the library you already use means the imports work directly, though you should confirm each match is the icon you intended.
Engr Mejba Ahmed

Need this built for real?

Engr Mejba Ahmed

AI Developer · Software Engineer

I'm Mejba — I design and ship production AI systems, automations, and full-stack apps. If you want this turned into a working solution for your team, let's talk.

More in Gemini AI Prompts

Engr Mejba Ahmed

Engr Mejba Ahmed

Claude Code Expert · Online

👋

Hey there!

Quick Actions

WhatsApp Instant reply

Chat on WhatsApp

+880 1723 741224 · Instant reply

Popular Questions

Engr Mejba Ahmed is connected
Engr Mejba Ahmed is typing...
Engr Mejba Ahmed avatar

✉ Want me to follow up? Drop your email

Engr Mejba Ahmed avatar

📞 Connect Directly

Choose how you'd like to reach me

WhatsApp

+880 1723 741224

Email

[email protected]

✓ Details sent! I'll get back to you shortly.

Powered by OpenAI

335+

Blog Posts

25

AI Courses

63

Projects

Services & Expertise

Pricing & Process

Learning & Resources

Connect & Support