Screenshot to Code — Convert Designs to Code
Screenshot to Code converts screenshots, mockups, and Figma designs into clean code using AI. 72.1K+ GitHub stars. HTML, React, Vue, Bootstrap. MIT.
Staging sûr pour cet actif
Cet actif est d'abord staged. Le prompt copié demande à l'agent d'inspecter les fichiers staged avant d'activer scripts, config MCP ou config globale.
npx -y tokrepo@latest install e8c64554-d3b8-402d-b5c7-74bce0b57159 --target codexStage les fichiers d'abord; l'activation exige la revue du README et du plan staged.
What it is
Screenshot to Code is an open-source tool that converts screenshots, mockups, and Figma designs into clean, functional code. It uses AI vision models to interpret visual layouts and generate HTML, React, Vue, or Bootstrap code that reproduces the design.
The tool targets developers and designers who want to accelerate the design-to-code workflow. Instead of manually coding a layout from a mockup, upload a screenshot and get working code in seconds.
How it saves time or tokens
Manually converting a design mockup to code takes hours of measuring spacing, matching colors, and writing responsive CSS. Screenshot to Code automates this translation, producing a working first draft that developers can refine.
The generated code uses standard HTML and CSS rather than proprietary components, making it easy for AI coding assistants to further modify and extend.
How to use
- Clone and run the application:
git clone https://github.com/abi/screenshot-to-code.git
cd screenshot-to-code
pip install -r requirements.txt
cd frontend && npm install && npm run dev
- Open the web UI and upload a screenshot or paste a URL.
- Select the output format (HTML/CSS, React, Vue, Bootstrap).
- The AI analyzes the visual layout and generates code that reproduces the design.
- Copy the generated code and integrate it into your project.
Example
<!-- Generated from a landing page screenshot -->
<section style='display: flex; flex-direction: column; align-items: center; padding: 4rem 2rem;'>
<h1 style='font-size: 2.5rem; font-weight: 700; margin-bottom: 1rem;'>Build Faster with AI</h1>
<p style='font-size: 1.2rem; color: #666; max-width: 600px; text-align: center;'>Convert any design into production-ready code in seconds.</p>
<button style='margin-top: 2rem; padding: 0.75rem 2rem; background: #2563eb; color: white; border-radius: 8px; border: none;'>Get Started</button>
</section>
Related on TokRepo
- AI Tools for Design — AI-powered design tools and converters
- AI Tools for Coding — AI code generation from various inputs
Common pitfalls
- Expecting pixel-perfect output. AI vision models approximate layouts. The generated code is a starting point, not a finished product. Plan for manual refinement of spacing, fonts, and responsive behavior.
- Using low-resolution screenshots. Higher resolution inputs produce better results. Crop tightly to the area you want converted.
- Not specifying the output framework. The default HTML output may not match your project stack. Select React or Vue if that is what your project uses.
- Failing to review community discussions and changelogs before upgrading. Breaking changes in major versions can disrupt existing workflows. Pin versions in production and test upgrades in staging first.
Questions fréquentes
Screenshot to Code produces a reasonable approximation of the input design. Simple layouts with clear structure convert well. Complex designs with overlapping elements, custom fonts, or animations require manual adjustment after generation.
Screenshot to Code supports multiple vision-capable models including GPT-4o, Claude, and Gemini. The model interprets the visual layout and generates code. You need an API key for your chosen model provider.
Screenshot to Code works with screenshots of Figma designs. For direct Figma integration, export your design as an image and upload it. Some workflows also support pasting Figma URLs for automatic screenshot capture.
Screenshot to Code generates HTML/CSS, React (JSX), Vue, and Bootstrap code. The output uses standard web technologies without proprietary dependencies, making it easy to integrate into any project.
The tool is open-source under the MIT license and free to self-host. You pay for the AI model API calls (OpenAI, Anthropic, or Google). A hosted version is also available for users who prefer not to run it locally.
Sources citées (3)
- Screenshot to Code GitHub— Screenshot to Code converts designs to HTML, React, Vue, and Bootstrap code
- OpenAI Documentation— GPT-4 Vision capabilities for image understanding
- Anthropic Documentation— Claude vision model for multimodal understanding
En lien sur TokRepo
Source et remerciements
abi/screenshot-to-code — 72,100+ GitHub stars
Fil de discussion
Actifs similaires
Umi-OCR — Free Offline OCR Tool for Screenshots, Images & PDFs
Open-source, privacy-first OCR software that runs entirely offline. Supports batch image import, PDF recognition, QR code scanning, and multi-language text extraction without sending data to external servers.
Carbon — Create Beautiful Images of Your Source Code
A web application that generates aesthetically styled screenshots of source code with syntax highlighting, custom themes, and export options.
Graphify — Repo Knowledge Graph + MCP
Graphify extracts docs/code into a knowledge graph and can install as an MCP/skill across Claude Code, Cursor, Codex, and Gemini CLI. Install via uv/pipx.
Playwright MCP Server — Browser Automation for AI
Official Playwright MCP server for browser automation. Lets Claude Code, Cursor, and other AI tools navigate pages, fill forms, click buttons, take screenshots, and run end-to-end tests via natural la