Lune

CVPR2026Top-tier venue

Widget2Code: From Visual Widgets to UI Code via Multimodal LLMs

Houston H. Zhang, Tao Zhang, Baoze Lin, Yuanqi Xue, Yincheng Zhu, Huan Liu, Li Gu, Linfeng Ye, Ziqiang Wang, Xinxin Zuo, Yang Wang, Yuanhao Yu, Zhixiang Chi

Abstract

User interface to code (UI2Code) aims to generate executable code that can faithfully reconstruct a given input UI. Prior work focuses largely on web pages and mobile screens, leaving app widgets underexplored. Unlike web or mobile UIs with rich hierarchical context, widgets are compact, context-free micro-interfaces that summarize key information through dense layouts and iconography under strict spatial constraints. Moreover, while (image, code) pairs are widely available for web or mobile UIs, widget designs are proprietary and lack accessible markup. We formalize this setting as the Widget-to-Code (Widget2Code) and introduce an image-only widget benchmark with fine-grained, multi-dimensional evaluation metrics. Benchmarking shows that although generalized multimodal large language models (MLLMs) outperform specialized UI2Code methods, they still produce unreliable and visually inconsistent code. To address these limitations, we develop a baseline that jointly advances perceptual understanding and structured code generation. At the perceptual level, we follow widget design principles to assemble atomic components into complete layouts, equipped with icon retrieval and reusable visualization modules. At the system level, we design an end-to-end infrastructure, WidgetFactory, which includes a framework-agnostic widget-tailored domain-specific language (WidgetDSL) and a compiler that translates it into multiple front-end implementations (e.g., React, HTML/CSS). An adaptive rendering module further refines spatial dimensions to satisfy compactness constraints. Together, these contributions substantially enhance visual fidelity, establishing a strong baseline and unified infrastructure for future Widget2Code research.

Ask Lune

Know this paper in minutes, not an afternoon.

Lune can read every page of it and the top-tier papers that cite it, and gives you its claims, its evidence and its limits, each one cited to the paper it comes from. No skimming, no AI slop.

3 top-tier papers have cited it since. Know what they found before your reviewers do.

Questions to start from

Lune can draw on

the full paper · the top-tier papers that cite it · related work

Get the answer

Free to start. No credit card required.

Lineage

  • MulFCoder: Framework-conditioned Multi-agent for MLLM-based Multi-framework Front-end Code Generation cites BLIP-2: Bootstrapping Language-Image Pre-training with Frozen Image Encoders and Large Language Models
  • MulFCoder: Framework-conditioned Multi-agent for MLLM-based Multi-framework Front-end Code Generation cites Flamingo: a Visual Language Model for Few-Shot Learning
  • BLIP-2: Bootstrapping Language-Image Pre-training with Frozen Image Encoders and Large Language Models cites Flamingo: a Visual Language Model for Few-Shot Learning
  • Boosting Multimodal Large Language Models with Visual Tokens Withdrawal for Rapid Inference cites BLIP-2: Bootstrapping Language-Image Pre-training with Frozen Image Encoders and Large Language Models
  • Test-Time Domain Adaptation by Learning Domain-Aware Batch Normalization cites MetaGCD: Learning to Continually Learn in Generalized Category Discovery
  • ASMIL: Attention-Stabilized Multiple Instance Learning for Whole-Slide Imaging cites MetaGCD: Learning to Continually Learn in Generalized Category Discovery
  • ASMIL: Attention-Stabilized Multiple Instance Learning for Whole-Slide Imaging cites Test-Time Domain Adaptation by Learning Domain-Aware Batch Normalization
Builds onCited byLeft to right by year; the more cited, the higher.

Cited by top-tier papers3

  1. ASMIL: Attention-Stabilized Multiple Instance Learning for Whole-Slide ImagingLinfeng Ye, Shayan Mohajer Hamidi, Zhixiang Chi, Guang Li et al.ICLR 2026 · 9 citations
  2. MulFCoder: Framework-conditioned Multi-agent for MLLM-based Multi-framework Front-end Code GenerationJie Wu, Haoran Ma, Shisong Tang, Yulin Xu et al.ICML 2026
  3. CL-DPS: A Contrastive Learning Approach to Blind Nonlinear Inverse Problem Solving via Diffusion Posterior SamplingLinfeng Ye, Shayan Mohajer Hamidi, Mert Pilanci, Konstantinos N. PlataniotisICLR 2026

Builds on24

  1. BLIP-2: Bootstrapping Language-Image Pre-training with Frozen Image Encoders and Large Language ModelsJunnan Li, Dongxu Li, Silvio Savarese, Steven C. H. HoiICML 2023 · 7,873 citations
  2. Flamingo: a Visual Language Model for Few-Shot LearningJean-Baptiste Alayrac, Jeff Donahue, Pauline Luc, Antoine Miech et al.NeurIPS 2022 · 6,707 citations
  3. Boosting Multimodal Large Language Models with Visual Tokens Withdrawal for Rapid InferenceZhihang Lin, Mingbao Lin, Luxi Lin, Rongrong JiAAAI 2025 · 121 citations
  4. MetaGCD: Learning to Continually Learn in Generalized Category DiscoveryYanan Wu, Zhixiang Chi, Yang Wang, Songhe FengICCV 2023 · 50 citations
  5. Test-Time Domain Adaptation by Learning Domain-Aware Batch NormalizationYanan Wu, Zhixiang Chi, Yang Wang, Konstantinos N. Plataniotis et al.AAAI 2024 · 41 citations

Related papers

  1. MLLM-Based UI2Code Automation Guided by UI Layout InformationFan Wu, Cuiyun Gao, Shuqing Li, Xin-Cheng Wen et al.ISSTA 2025 · 5 citations
  2. Component-based Reusable UI Code Generation for Complex Websites via Semantic Segmentation and Fine-grained FeedbackJingyu Xiao, Jiantong Qin, Shuoqi Li, Man Ho Lam et al.KDD 2026 · 1 citation
  3. Omni-I2C: A Holistic Benchmark for High-Fidelity Image-to-Code GenerationJiawei Zhou, Chi Zhang, Xiang Feng, Qiming Zhang et al.ACL 2026 · 2 citations
  4. Figma2Code: Automating Multimodal Design to Code in the WildYi Gui, Jiawan Zhang, Yina Wang, Tianran Ma et al.ICLR 2026 · 3 citations
  5. Reasoning for Mobile User Experience with Multimodal LLMs: Task, Benchmark, and ApproachRuichao Mao, Zhou Fang, Teng Guo, Hao Yang, Yaping Li, Shaohua Peng, Maji Huang, Xiaoyu Lin, Shuoyang Liu, Xuepeng Li, Yuyu Zhang, Hai RaoCVPR Findings 2026
Dusk over the sea between two cliffs drawn in fine vertical lines