From HTML to editable Figma
I designed and tested a pipeline that turns HTML screens into editable Figma designs with auto layout, live text, and icon components.
An AI coding agent wrote the code.
  • 52 → 0 manual fixes on the test screens
  • 7 weeks
Why it matters: a designer can prototype a screen in HTML and hand over a Figma file that an artist can use without rebuilding the layout.
At a glance
Role: Product owner. I wrote the requirements and test rules, made 6 key decisions, and ran all live tests in Figma and the browser
Built with: Qwen3.8-27b (AI coding agent), Figma plugin API, Chromium
Period: 24 Sep – 14 Nov 2026
Result: HTML → editable Figma: auto layout, text, icon components
Manual fix: one meaningful edit I had to make in Figma after the import (counting rule in Results).
Cover image: generated with Google Gemini.
See it in action
Why eight different screens?
One clean import can be luck. The test set is deliberately mixed: mobile and desktop layouts, cards, tables, dark themes, long texts. A tool is only trustworthy when it behaves the same on every screen type. Zero manual fixes on all eight is the result I would want to see before trusting it, but these screens were also used to tune it. The test on other people's HTML is the next step.
1. The problem
Drawing every screen by hand in Figma is slow. I wanted to build a screen as HTML first, and then move it into Figma as real layers, not as a picture. Existing tools can import HTML, but the result needs cleaning before a designer can work with it. My goal was a result that is ready to hand over to a visual artist with no manual fixes.
I set four rules for “done” before I measured anything:
  1. Every container is an auto layout frame.
  2. Icons are components.
  3. No text overflow.
  4. Layers have meaningful names.
2. How it works
Five steps, left to right:
  1. HTML page. A screen written as a normal web page.
  2. Converter. It runs in the browser, so it measures what the browser really shows: sizes, colors, fonts, text. I start it from a one-click page on a local server.
  3. JSON file. The result of the measurement. It is the contract between the two halves of the system.
  4. Figma plugin. It reads the JSON and builds the layers.
  5. Figma. Editable frames, text, auto layout and components.
Diagram of the pipeline in five steps, left to right: HTML page, converter, JSON contract, Figma plugin, editable Figma. Steps 2 and 4 are the frozen code
In screenshots: “One-Click” is the converter page (step 2), “JSON → Figma” is the Figma plugin (step 4), “HTML2Figma” is the demo video’s title. “bench” in file names is the internal name of the test set. The Figma plugin in the video has a Russian UI (an internal tool): “Fetch last” and “Create → Figma” in the screenshots are the buttons «Забрать последний JSON (с локального сервера)» and «Создать → Figma».
The one-click page after a finished run on the WMS «Priemki» screen: the form with the page address, the Make JSON button, and a green «Done» banner — 295 nodes, 10 warnings..
A real run on the WMS «Priemki» screen: one click, JSON saved — 295 nodes, 10 warnings (recorded decisions — see Results).
3. Who did what
The AI agent wrote all the code, the self-tests, and the project documents. It cannot open Figma. So all the live work was mine:
  • I ran every import in Figma and every measurement in the browser.
  • I found 11 problems in live tests (13 separate defects, all in the first phase). Example: a prototype transition took 300 seconds because the agent sent milliseconds where the Figma API expects seconds.
  • I caught mistakes in the agent's own assessments. Example: it called an overflow “acceptable, about 8 px”. My screenshot showed about 14 px, and the agent confirmed the mistake.
  • I made the 6 key decisions of the project (next section).
The agent was fast and tireless. The quality bar and the final verdicts were mine.
Before/after of the trip list on the bus stop screen (Автобус 24) imported into Figma. Before the fix, the auto-detected component forced all trip titles onto one line, so «до Центральной площади» ran into the «19 мин» chip; after the fix (in the plugin code, HTML untouched), the title wraps to two lines like in the browser.
A bug I caught in a live test: the route text overlaps the “19 мин” value (left). Clean after the fix (right).
4. Key decisions
A JSON contract between the converter and the plugin. The alternative was to generate plugin code directly from HTML. The contract lets me test each half separately and change one half without breaking the other. The price is one extra file.
Measure in the browser; do not parse HTML. The browser has already calculated sizes, styles, and font metrics. Rebuilding that would mean writing a small browser. The price: results depend a little on the browser, so I used one reference browser for all checks.
Icons are components, not pictures. Every icon has a name in the HTML and is matched to a component from my library. A picture cannot be swapped, recolored, or updated with the library. The price: one lookup table to fill. If an icon is not in the lookup table yet, the plugin creates its own master component from it. In the video log, «0 подменено, 7 не в таблице (остались свои)» means: no icons were swapped for library components on that run, because all 7 were new. It does not mean the library failed.
Repeated elements become components automatically. This was my idea after measuring a catalog screen: cards should be components, not copies. Marking them in the HTML was impossible (the test set was frozen), so the plugin detects repeats by itself.
Frozen test set, frozen core. I froze five test screens and the core code (the converter and the plugin). No change without my explicit approval, and the agent must run all self-checks before saying “done”. This protected working code from “quick fixes”. The core changed only in the first phase (52 → 0), each time with my approval. After v1.0, it was frozen, and only the HTML changed.
How I count. One manual fix is one meaningful action, counted per element (five edited texts in a card are five fixes). I set this rule myself. One known pattern is not counted: equal-length bars in component instances. This is a hard limit of the Figma API (an instance keeps the master’s size), and I documented it as a known v1 limitation.
Icons are components: one master per unique icon. 8 of the 11 team logos on this screen are used at two sizes (28 and 22 px), so the pipeline created 19 masters; the screen reuses them as instances.
Figma layer panel of the icons component frame («Иконки — мастера»): 19 icon masters — 11 team logos, 8 of them used at two sizes (28 and 22 px), so one master per unique icon — listed Icon 1 (team-vipers) through Icon 19 (team-crimson), with the icon previews in a column on the right. Shows the repeated logos imported as components, not pictures.
5. Results
Manual fixes on the test screens (5 frozen test screens plus 3 extra screens; I checked with file hashes that the frozen files did not change):
Manual fixes on the test screens at three stages. Before the fix round (7 screens): 52 in total — layout 24, text 10, size 10, icons 6, other 2. After the first fix round: 17. Final code (8 screens): 0.
What “0” means: it follows my counting rule (one fix = one meaningful action, per element). One known pattern is not counted: equal-length bars in component instances, a Figma API limit. 18 frames remain plain frames, not auto layout — all on one extra screen, not on the 8 test screens: containers the converter does not turn into auto layout (grids with unequal tracks, anonymous divs, a 1 px spacer). See Limits.
Each stage leaves a log: the one-click page prints its log in the browser, the plugin prints an import report in Figma. A warning is not an error: it means the stage made a decision and recorded it — on the WMS screen, for example, the converter reported five one-sided borders (v1 draws the stroke around the whole perimeter), four unrecognized border colors, and one flex-wrap row that is not auto-laid-out; the plugin reported eleven text shifts in table-cell instances that did not apply, and two fixed heights it was asked to make fluid. The log lists every warning in the stage that produced it so that you can trace each decision back.
Bar chart of manual fixes by type at three stages. Before the fix round: 52 in total (layout 24, text overflow 10, size 10, icons 6, other 2). After the first round: 17 (layout 2, size 14, other 1). Final code: 0 on all 8 screens
Test on new screens. I wrote 10 new prompts for AI-generated HTML screens (dark dashboards, tables, calendar, payment, settings, and others). 3 of 10 imported cleanly at first. After six rounds, 10 of 10 did. The core code stayed frozen: I fixed the HTML instead, and 13 recurring causes became reusable rules for the HTML generator. These are the same ten screens I tuned the rules on, so this is not yet a test on new HTML. One screen still has a harmless clip frame in the layer tree, and I accepted it.
Line chart of ten new screens that imported cleanly across six waves of fixes: 3, 5, 6, 8, 9, and finally 10 of 10
The 10 new AI-generated screens (N1–N10) imported cleanly after six rounds. The HTML rules were tuned on these same screens.
Three views of catalog screen 04: the original HTML in the browser (left, caption "HTML in Browser (reference)"), the Figma layer panel of the imported frame in the middle (bench-04-catalog: named layers statusbar, head, search, grid, card, plus a separate "Иконки — мастера" icon frame), and the same screen in Figma (right, caption "The same screen in Figma: named layers, auto layout, cards as components").
6. Comparison with other tools
I ran html.to.design (free version) on all 5 frozen test screens. I ran the Figma design agent on one simple screen.
Comparison table of this pipeline vs html.to.design (free) vs the Figma design agent, across five rows: editable text, auto layout, icons as components, multiple states and prototype links, and manual fixes on the test screens (0 on 5 / 4 plus cleanup / 0 on 1).
Where the others are better:
  • html.to.design takes any HTML without preparation, so it is faster for a one-time import.
  • The Figma design agent gave a clean result on a simple screen with no tooling at all.
What the canvas shows: after two small clip fixes on this screen (4 in total across all 5 screens), the html.to.design result and mine look the same (screen 04 below). The difference is in the layer tree: generic names (“Container”, “Background+Shadow”) and deep nesting on all five screens. On 02, it also adds an ad wrapper and keeps a default 1920 px viewport. On 05, the whole long page lands in one frame, and the footer floats over the text. I did not count this cleanup as fixes.
Layer panels side by side for the same catalog screen (04): html.to.design (left) and this pipeline (right). The competitor's tree is deep nesting of generic names (“Container”, “Background+Shadow”); the pipeline's tree has meaningful names (statusbar, head, search, grid, card) and a separate icon-master frame.
How to read this comparison: my pipeline was tuned on these screens, I used the free version of the competitor, I tested the Figma agent on one screen, and I did not check font matching exactly.
7. Limits and next steps
  • Works best with HTML that follows its documented patterns. Other tools accept any HTML. Not yet tested on pages written by other people: the planned test is 5 pages, no core changes, results published as they are.
  • 18 plain frames remain (not auto layout) — all on one extra screen, not on the 8 test screens: containers the converter does not turn into auto layout (grids with unequal tracks, anonymous divs, a 1 px spacer). Fixing them means unfreezing the core code, so I postponed it until after v1.0.
  • Figma's Inter font is about 4–5% wider than the browser font, so the HTML gives text boxes extra width (“safe zones”).
  • Layer names are meaningful for structure (statusbar, head, search, grid, card). Inside icons and maps, SVG paths keep the default name “Vector”.
  • Next: the plain-frame fix, then the test on third-party HTML.
What I take from this
Measure first, freeze the test set, count honestly. An AI agent can write the system, but it needs a person who sets the quality bar, runs the real tests, and says “not clean yet”. That is the part of the work I want to keep doing.
This site was made on Tilda — a website builder that helps to create a website without any code
Create a website