abi/screenshot-to-code

Drop in a screenshot and convert it to clean code (HTML/Tailwind/React/Vue)

What it solves

Manually writing front-end code from visual designs is slow and error-prone. This project replaces that process: you give it a screenshot, mockup, Figma design, or screen recording, and it generates clean, functional code in a variety of popular stacks (HTML + Tailwind, React + Tailwind, Vue, Bootstrap, Ionic, and more). It also extracts real assets (like logos) from the screenshot and can edit images or remove backgrounds.

How it works

The app has a React/Vite frontend and a FastAPI backend. You provide at least one AI model API key (OpenAI, Anthropic, or Gemini; Gemini is strongly recommended). The tool sends your visual input to a language model that generates the corresponding code. It can optionally use a headless browser to render its own generated page and visually check the result (screenshot preview). For video mode, it turns a screen recording into a functional prototype. You can run it locally, with Docker, or use the hosted version at screenshottocode.com.

Who it’s for

Developers, designers, and product teams who want to quickly prototype or convert existing designs into working code without writing everything by hand. It’s also useful for anyone who wants to self-host or customize the tool, or who prefers to keep their data and API keys under their own control.

Highlights

  • Supports multiple output stacks: HTML + Tailwind, HTML + CSS, React + Tailwind, Vue + Tailwind, Bootstrap, Ionic + Tailwind
  • Works with screenshots, mockups, Figma designs, and screen recordings
  • Can extract real assets (e.g., logos) from the input and reuse them in the generated code
  • Optional screenshot preview: the tool renders its own output in a headless browser and visually checks it
  • Runs locally, via Docker, or as a hosted app
  • Configurable to use different AI model providers (OpenAI, Anthropic, Gemini) and supports image editing/background removal via Replicate

Related

  • Project
  • Project
  • Project
  • Project
  • Project