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 · prompt

Prompting for UI: write specs, not wishes

阅读博客原文閱讀部落格原文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).

"Modern and clean" means nothing to a model. Name layout, tokens, states, content and what to avoid.

A UI prompt is a tiny design spec. The model fills every gap you leave with its defaults, and defaults are clichés: a centred hero, three feature cards, a purple-to-blue gradient, emoji as icons. A prompt that says "modern and clean" leaves every gap open. This post shows how to close them with a fixed structure, how to iterate without starting over, and which mistakes waste the most rounds.

Why "make it modern" fails

Language models predict the most likely continuation. For UI, the most likely continuation is the average of thousands of landing pages. Adjectives like modern , clean or premium do not narrow that average, because every template on the web claims all three. What narrows it is information the model cannot guess: your audience, your content, your tokens, your states, and the things you refuse.

Anthropic's prompt-engineering guide makes the same point in general terms: be clear and direct, give context, and say what the output is for. Vercel's v0 docs add the UI-specific version: describe the layout, name the components and give real content.

The six-slot template

Goal: pricing page for a dev tool, 3 tiers, annual/monthly toggle Layout: 12-col grid, max 1200px; tiers in one row at >= 900px, stacked below Tokens: Geist; body 14/20; radius 10; one accent #2563eb; neutral greys only States: hover, focus-visible ring, selected tier, loading on the CTA, disabled Content: use the copy below verbatim (no lorem); prices 0 / 19 / 49 USD Avoid: gradient text, glassmorphism, emoji icons, everything centred, drop shadows > 8px

Each slot answers one question the model would otherwise answer with a default:

A worked example, step by step

Step 1: write the brief. Before the six slots, write two sentences about the audience: "Solo developers comparing three plans on a phone during a commute. They care about the limits table more than the hero." This decides density and what goes above the fold.

Step 2: ask for variants, not a page. The first message should ask for three deliberately different directions, for example "A: editorial, serif headings; B: dense table-first; C: card-based with a toggle". Diversity is cheap for the model and expensive for you to imagine.

Step 3: pick one and critique in named problems. "Make it better" produces random change. Named problems produce targeted change:

Keep variant B. Fix only these: 1. Line length in the FAQ is ~95ch; cap at 68ch. 2. Two accent colours compete (blue CTA, green badge). Use the accent for the CTA only. 3. The selected tier has no visible focus ring when tabbing. 4. Prices are not tabular; use font-variant-numeric: tabular-nums. Do not change anything else.

Step 4: lock decisions. When a decision is good, move it out of the chat into a file the agent reads every time (a DESIGN.md or token file). Otherwise the next session starts from the average again.

Pitfalls that waste the most rounds

Slot values for three common screens

The template stays the same; what changes is which slots carry the weight. Three examples we reuse:

DATA TABLE Layout: full width inside a 1280px shell; sticky header; first column sticky on < 768px Tokens: 13/18 table text; tabular-nums; row height 40; zebra off; 1px dividers States: sorted column, row hover, row selected (checkbox), loading skeleton rows, empty, error with retry Content: 8 real rows incl. one 60-char name and one negative number Avoid: cards on mobile (keep the table, scroll horizontally), icons in every cell

EMPTY STATE Goal: first-run screen for a project list with zero projects Layout: centred block max 420px; illustration optional, max 160px tall Content: one-line headline, one sentence of help, one primary action, one docs link Avoid: three CTAs, jokes, stock 3D illustrations

SETTINGS FORM Layout: label column 200px + field column at >= 768px; single column below States: dirty (unsaved) bar, inline validation on blur, saving, saved toast, server error per field Avoid: modal dialogs for each setting, auto-save without feedback

Notice that the data table spends its words on states and content, the empty state on content and restraint, and the form on states. When a prompt fails, check which slot that screen depends on and whether you left it to the default.

How to tell if a prompt is done

A useful test: hand the prompt to a colleague and ask them to sketch the screen in two minutes. If they ask "what colour?", "what happens on mobile?" or "what does the button say?", the model would have guessed too. Every question they ask is a slot you have not filled. A second test: could you reject the output using only the prompt? If "it looks off" is your only objection, the prompt has no checkable rules, and the next round will be a lottery.

Keeping reusable prompts

Keep one prompt per component type (pricing, settings form, data table, empty state) in your repo. Each one is the six slots with your tokens already filled in, so a new screen only needs Goal and Content. UI Hub's component cards include a copyable prompt you can start from, and the AI prompt block at the end of this post is a ready-made reviewer prompt.

Checklist

References