From Visual Widgets to UI Code: Efficient Tool-Grounded Generation

Houston H. Zhang, Tao Zhang, Li Gu, Linfeng Ye, Yuanhao Yu +3 more
8/12/2026
cs.CVcs.LG

No confident code implementation found for this paper.

Abstract

Existing screenshot-to-code systems face a trade-off between flexibility and controllability. Direct multimodal generation can hallucinate visible details, whereas structured pipelines reduce such errors through component-wise decomposition, predefined templates, and customized intermediate representations.

Show full abstract

These structures, however, introduce additional generative orchestration and restrict outputs to designs covered by the representation. We investigate whether selective tool grounding can improve the fidelity--efficiency trade-off of direct widget-to-code generation. We introduce \textbf{WidgetGen}, a lightweight tool-grounded framework that extracts observable text and color evidence, performs high-level layout and optional chart reasoning, and directly generates executable JavaScript XML (\emph{JSX}). This design reduces reliance on component-wise generation while avoiding a fixed UI schema. Across six multimodal models and \(1{,}000\) held-out widgets, WidgetGen outperforms direct prompting and the structured Widget2Code pipeline on most visual reconstruction metrics, with consistent gains in area, legibility, and style. Finally, reconstruction-derived image-code pairs improve six Qwen-family open-weight models across every reported metric through supervised fine-tuning. These results establish WidgetGen as a strong lightweight baseline and show that selective evidence grounding offers an effective alternative to extensive representation constraints.

View on arXivView PDF

Code Implementations

No confident code match yet

We couldn't find an author-owned or strongly-evidenced community implementation for this paper. Any repos shown below are weak matches — verify before relying on them.

No code implementations found yet.

Know of an implementation? Let us know in the comments below!

Similar Papers

Cite this paper

@article{zhang2026from,
  title  = {From Visual Widgets to UI Code: Efficient Tool-Grounded Generation},
  author = {Houston H. Zhang and Tao Zhang and Li Gu and Linfeng Ye and Yuanhao Yu and Xinxin Zuo and Yang Wang and Zhixiang Chi},
  year   = {2026},
  eprint = {2608.12611},
  archivePrefix = {arXiv},
  url    = {http://arxiv.org/abs/2608.12611v1}
}

Add a badge to your README

Shows whether official code is linked for this paper.

Code of Paper badge
[![Code of Paper](https://codeofpaper.com/badge/2608.12611.svg)](https://codeofpaper.com/paper/2608.12611)

Discussion