UI Hub 是一个每日更新的免费 UI 资源目录,给设计师、前端开发者和做界面的 AI Agent 用:共 2,395 条资源,其中 133 个组件库、1,929 个带明暗预览的组件样式示例,另有设计 skill 与 AI 设计技巧文章。UI Hub 是一個每日更新的免費 UI 資源目錄,給設計師、前端開發者和做介面的 AI Agent 用:共 2,395 條資源,其中 133 個元件庫、1,929 個附明暗預覽的元件樣式示例,另有設計 skill 與 AI 設計技巧文章。UI Hub is a free, daily-updated directory of UI resources for designers, front-end developers and AI agents that build interfaces: 2,395 resources, including 133 component libraries and 1,929 component style demos with light/dark previews, plus design skills and AI design articles.UI Hub は、デザイナー・フロントエンド開発者・UI を作る AI エージェント向けの、毎日更新される無料の UI リソース集です。全 2,395 件(コンポーネントライブラリ 133 件、ライト/ダーク対応のスタイルデモ 1,929 件)に加え、デザインスキルと AI デザイン記事を掲載しています。UI Hub는 디자이너, 프론트엔드 개발자, 인터페이스를 만드는 AI 에이전트를 위한 매일 업데이트되는 무료 UI 리소스 디렉터리입니다. 총 2,395개 리소스(컴포넌트 라이브러리 133개, 라이트/다크 미리보기가 있는 스타일 데모 1,929개)와 디자인 스킬, AI 디자인 글을 제공합니다.UI Hub ialah direktori sumber UI percuma yang dikemas kini setiap hari untuk pereka, pembangun front-end dan ejen AI yang membina antara muka: 2,395 sumber, termasuk 133 pustaka komponen dan 1,929 demo gaya komponen dengan pratonton terang/gelap, serta kemahiran reka bentuk dan artikel reka bentuk AI.UI Hub là danh mục tài nguyên UI miễn phí, cập nhật hằng ngày, dành cho nhà thiết kế, lập trình viên front-end và AI agent dựng giao diện: 2,395 tài nguyên, gồm 133 thư viện component và 1,929 mẫu phong cách component có xem trước sáng/tối, cùng skill thiết kế và bài viết về thiết kế với AI.UI Hub est un annuaire gratuit de ressources UI, mis à jour chaque jour, pour designers, développeurs front-end et agents IA qui construisent des interfaces : 2,395 ressources, dont 133 bibliothèques de composants et 1,929 démos de styles avec aperçus clair/sombre, plus des skills de design et des articles sur le design avec l’IA.UI Hub es un directorio gratuito de recursos de UI, actualizado a diario, para diseñadores, desarrolladores front-end y agentes de IA que construyen interfaces: 2,395 recursos, incluidas 133 bibliotecas de componentes y 1,929 demos de estilos con vista clara/oscura, además de skills de diseño y artículos de diseño con IA.UI Hub ist ein kostenloses, täglich aktualisiertes Verzeichnis von UI-Ressourcen für Designer, Frontend-Entwickler und KI-Agents, die Oberflächen bauen: 2,395 Ressourcen, darunter 133 Komponentenbibliotheken und 1,929 Komponenten-Stildemos mit Hell/Dunkel-Vorschau, dazu Design-Skills und Artikel zu KI-Design.

← 百科百科Encyclopedia百科백과EnsiklopediaBách khoaEncyclopédieEnciclopediaEnzyklopädie · 笔记筆記Noteノート노트NotaGhi chúNoteNotaNotiz · blog · design-to-code · Figma

Design-to-code with AI: map to your components, not to pixels

阅读博客原文閱讀部落格原文Read the blog postブログ記事を読む블로그 글 읽기Baca artikel blogĐọc bài blogLire l’articleLeer el artículoBlogbeitrag lesen →原始 Markdown原始 MarkdownRaw Markdown生Markdown원본 MarkdownMarkdown mentahMarkdown gốcMarkdown brutMarkdown en brutoRohes Markdown

本条目正文为英文,作为 AI Agent 上下文使用。

本條目正文為英文,作為 AI Agent 上下文使用。

この項目の本文は英語です(AIエージェントの文脈用)。

이 항목의 본문은 영어입니다(AI 에이전트 컨텍스트용).

Kandungan entri ini dalam bahasa Inggeris (untuk konteks ejen AI).

Nội dung mục này bằng tiếng Anh (dùng làm ngữ cảnh cho AI agent).

Le contenu de cette entrée est en anglais (contexte pour agents IA).

El contenido de esta entrada está en inglés (contexto para agentes de IA).

Der Inhalt dieses Eintrags ist auf Englisch (Kontext für KI-Agents).

Pixel-perfect export creates throwaway code. Give the agent your component registry and tokens via MCP so output reuses what you already ship.

Early design-to-code tools translated frames into absolutely positioned divs. The result looked right in one viewport and was unmaintainable everywhere else. The current generation works differently. Figma's MCP server, Builder.io's Visual Copilot and agents running inside Cursor or Claude Code read structure and variables and can map them to code you already own. Whether you get reusable code or throwaway markup now depends less on the tool and more on what you feed it.

The core idea: map, don't trace

A design file contains three kinds of information: structure (frames, auto-layout, nesting), decisions (variables for colour, spacing, radius, type) and components (instances of a button, an input, a card). Tracing copies the pixels. Mapping turns structure into flex and grid, decisions into your CSS variables, and component instances into your own <Button> and <Input>. Mapped output is a pull request you can merge. Traced output is a screenshot written in HTML.

Step 1: make the design file readable

Models can only map what is explicit. Before you connect any tool:

Step 2: export tokens as code

Keep one source of truth for design decisions and generate CSS variables from it. The Design Tokens Community Group format is a JSON shape that tools like Style Dictionary can transform:

{ "color": { "accent": { "$type": "color", "$value": "#2563eb" }, "surface": { "$type": "color", "$value": "#ffffff" } }, "radius": { "md": { "$type": "dimension", "$value": "10px" } } }

:root { --color-accent: #2563eb; --color-surface: #ffffff; --radius-md: 10px; } [data-theme="dark"] { --color-surface: #0d0f15; }

When the agent sees that color/accent in Figma and --color-accent in CSS share a name, it uses the variable instead of pasting hex values.

Step 3: publish a component registry

A registry tells tools which components exist in your codebase and how to install them. With shadcn/ui, a registry.json lists your items and the CLI builds them into installable JSON files:

build registry items from registry.json into public/r/

npx shadcn@latest build

install one of your own components into another project

npx shadcn@latest add https://your-domain.com/r/pricing-card.json

Figma's Code Connect solves the same problem from the design side: it links a Figma component to the code component, so design context sent to an agent can say "this is <Button variant="primary">" instead of describing a blue rectangle.

Step 4: connect the bridge

The Figma MCP server exposes the selected frame's structure, variables and component mappings to an MCP client such as Cursor, VS Code or Claude Code. The workflow is short:

Builder.io's Visual Copilot follows a similar path from a Figma plugin and can also map to your components. Whichever bridge you use, the quality ceiling is set by Steps 1–3.

Step 5: review generated code like a junior's PR

Generated UI is usually right in the default state and wrong at the edges. Review these every time:

quick checks on a generated diff

git diff | grep -nE '#[0-9a-fA-F]{3,6}\b' # raw hex colours git diff | grep -nE '\b[0-9]{2,}px\b' # magic pixel values git diff | grep -n 'onClick' | grep -n '<div' # clickable divs

Pitfalls

Questions we get

Is it worth it for a small project? If you will build fewer than five screens, skip the registry and just give the agent your tokens file and a list of components. The full pipeline pays off when several people or several agents build screens over months.

What if the design file is messy and we cannot fix it? Then do not convert from it directly. Ask the agent to describe the frame in words first (sections, components, content), correct that description, and generate from the description plus your kit. A clean description beats a messy file.

Which bridge should we pick? Pick the one your designers already use and that can see your component mappings. The bridge matters less than whether variables, auto-layout and component instances exist in the file.

How do we measure success? Count how much generated code survives review unchanged, and how many raw values reviewers had to replace with tokens. Both numbers should improve week over week as the registry grows.

Our take

Treat the registry and token pipeline as infrastructure, not a one-off. The first screen takes longer because you are setting up mappings; every later screen gets cheaper because the agent reuses them. Teams that skip this step get fast first drafts and slow maintenance forever.

Checklist

References