𝗚𝗣𝗧-5.4 可以构建漂亮的前端
但前提是你知道如何提问。
更好的输出始于更严格的约束、视觉参考和真实内容。
以下是如何使用 GPT-5.4 构建有意图的前端。
𝗣𝗧-5.4 为什么默认生成通用内容
没有具体指导时,每个模型都会默认使用训练期间见过的最常见模式。
通用的卡片网格。薄弱的视觉层次。安全、容易被遗忘的布局。
GPT-5.4 在前端工作上明显更出色。
它能生成更具视觉野心的用户界面,原生理解图像,并能使用 Playwright 等工具验证和优化自己的输出。
但它仍然需要方向。模型的意图性取决于你的提示。
从这里开始:4 个基础
→ 设置推理为低或中等
违反直觉,但能带来更强的结果。保持模型快速且专注。
→ 预先定义你的设计系统
字体排印、配色方案、布局规则。在任何代码之前。
→ 提供视觉参考
截图、情绪板,任何东西。模型能从图像中推断节奏、间距和比例。
→ 提供真实内容
真实文案、真实产品背景。占位文本只会产生占位思维。
实际有效的设计规则
严格约束模型。OpenAI 自身的启动提示包括如下规则:
→ 单一构图——第一个视口必须呈现为一个完整构图
→ 主图中绝不使用卡片。永远不行。
→ 品牌优先——在品牌页面上,产品名称必须是主视觉级别
→ 默认情况下,着陆页主图全屏
→ 最多两种字体。一种强调色。
→ 每个版块只做一件事。一个目的。一个核心信息。
试金石:如果你移除主图页面仍然可用,则说明图像太弱。
将页面结构化为叙事
在构建之前,先写下三件事:
- 视觉论点 — 用一句话描述情绪和能量
- 内容计划 — 主角、支持、细节、最终行动号召(CTA)
- 互动论点 — 2-3 个动作创意
然后按照以下顺序进行:
- 主角(Hero) — 确立身份和承诺
- 支持性图像(Supporting imagery) — 展示背景情境
- 产品细节(Product detail) — 解释产品或服务
- 社会证明(Social proof) — 建立可信度
- 最终行动号召(Final CTA) — 转化用户
每个部分只承担一个任务。如果一个部分试图完成两个任务,就去掉其中一个。
应用程序 vs 着陆页
对于应用程序和仪表盘,适用不同的规则。默认采用类似 Linear 风格的克制设计:
→ 平静的表面层级
→ 强调排版与间距
→ 少量配色
→ 信息密集但可读
→ 仅当卡片本身就是交互时才使用卡片
避免使用仪表盘式的卡片拼贴、在每个区域使用粗边框、装饰性渐变,以及多个相互竞争的强调色。
检验标准: 如果操作人员只浏览标题、标签和数字——他们能否立即理解页面?
𝗠𝗼𝘁𝗶𝗼𝗻:发布 2-3 个,而不是 10 个
动效创造存在感和层级,而不是噪音。
选择三个有意图的动效,并坚持使用:
- → 英雄区中的一个入场序列
- → 一个与滚动关联或粘性的效果
- → 一个悬停、显现或布局过渡
推荐使用 Framer Motion 作为技术栈。如果某个动效只是装饰性的,就把它移除。
𝗧𝗵𝗲 𝗳𝗿𝗼𝗻𝘁𝗲𝗻𝗱 𝘀𝗸𝗶𝗹𝗹
OpenAI 发布了一个开源技能,将所有这些内容编码为一个可复用的提示层。
使用以下命令安装:
$skill-installer frontend-skill
它会在接触任何代码之前,强制模型先定义视觉论点、内容计划和交互论点。在你的下一次构建之前运行它是值得的。
𝗧𝗹𝗱𝗿
GPT-5.4 可以生成真正优秀的前端。但前提是你需要:
- 提前限制布局系统
- 提供可参考的视觉素材
- 将页面结构化为叙事,而不是文档
- 使用真实内容,而不是占位符
- 保持推理层次在低到中等
模型是有能力的。提示就是设计说明书。
你打算用它构建的第一件事是什么? 👇
使用 GPT-5.4 设计令人愉悦的前端
用于将 GPT-5.4 引导至精致、可投入生产的前端设计的实用技术。
作者:Brian Fioca、Alistair Gillespie、Kevin Leneway、Robert Tinn
GPT-5.4 比其前代模型是更出色的网页开发者——能够生成更具视觉吸引力且更大胆的前端。值得注意的是,我们在训练 GPT-5.4 时特别强化了其UI 能力和图像使用能力。在适当引导下,该模型可以生成包含细腻细节、精心设计的交互以及精美图像的生产级前端。
网页设计会产生大量不同的结果。优秀的设计需要在克制与创新之间取得平衡——既借鉴经得起时间考验的模式,又引入新意。GPT-5.4 已学习到这种广泛的设计方法,并理解网站可以通过多种方式构建。 citeturn1search0
当提示信息不够具体时,模型往往会回退到训练数据中的高频模式。其中一些是成熟的设计惯例,但也有许多只是被过度重复的习惯,而我们希望避免它们。结果通常是看似合理且可用,但可能会逐渐趋向于通用结构、薄弱的视觉层级,以及无法达到我们预期的设计选择。 citeturn1search0
本指南将介绍一些实用技术,用于将 GPT-5.4 引导至打造你所设想的设计。
显示英文原文 / Show English Original
𝗚𝗣𝗧-𝟱.𝟰 𝗰𝗮𝗻 𝗯𝘂𝗶𝗹𝗱 𝗯𝗲𝗮𝘂𝘁𝗶𝗳𝘂𝗹 𝗳𝗿𝗼𝗻𝘁𝗲𝗻𝗱𝘀. 𝗕𝘂𝘁 𝗼𝗻𝗹𝘆 𝗶𝗳 𝘆𝗼𝘂 𝗸𝗻𝗼𝘄 𝗵𝗼𝘄 𝘁𝗼 𝗮𝘀𝗸.
Better output starts with tighter constraints, visual references, and real content.
Here's how to build intentional frontends with GPT-5.4. 𝗪𝗵𝘆 𝗚𝗣𝗧-𝟱.𝟰 𝗱𝗲𝗳𝗮𝘂𝗹𝘁𝘀 𝘁𝗼 𝗴𝗲𝗻𝗲𝗿𝗶𝗰
Without specific guidance, every model defaults to the most common patterns it saw during training.
Generic card grids. Weak visual hierarchies. Safe, forgettable layouts.
GPT-5.4 is significantly better at frontend work.
It generates more visually ambitious UIs, understands images natively, and can use tools like Playwright to verify and refine its own output.
But it still needs direction. The model is only as intentional as your prompt. 𝗦𝘁𝗮𝗿𝘁 𝗵𝗲𝗿𝗲: 𝟰 𝗳𝗼𝘂𝗻𝗱𝗮𝘁𝗶𝗼𝗻𝘀
→ Set reasoning to low or medium
Counterintuitive, but it leads to stronger results. Keeps the model fast and focused.
→ Define your design system upfront
Typography, color palette, layout rules. Before any code.
→ Provide visual references
A screenshot, a mood board, anything. The model infers rhythm, spacing, and scale from images.
→ Give it real content
Real copy, real product context. Placeholder text produces placeholder thinking. 𝗗𝗲𝘀𝗶𝗴𝗻 𝗿𝘂𝗹𝗲𝘀 𝘁𝗵𝗮𝘁 𝗮𝗰𝘁𝘂𝗮𝗹𝗹𝘆 𝘄𝗼𝗿𝗸
Constrain the model hard. OpenAI's own starter prompt includes rules like:
→ One composition — the first viewport must read as a single composition
→ No cards in the hero. Ever.
→ Brand first — the product name must be hero-level on branded pages
→ Full-bleed hero by default on landing pages
→ Two typefaces max. One accent color.
→ One job per section. One purpose. One takeaway.
Litmus check: if you remove the hero image and the page still works, the image was too weak. 𝗦𝘁𝗿𝘂𝗰𝘁𝘂𝗿𝗲 𝘁𝗵𝗲 𝗽𝗮𝗴𝗲 𝗮𝘀 𝗮 𝗻𝗮𝗿𝗿𝗮𝘁𝗶𝘃𝗲
Before you build, write three things:
→ Visual thesis — one sentence on the mood and energy
→ Content plan — hero, support, detail, final CTA
→ Interaction thesis — 2-3 motion ideas
Then follow this sequence:
1. Hero — establish identity and promise
2. Supporting imagery — show context
3. Product detail — explain the offering
4. Social proof — build credibility
5. Final CTA — convert
Each section gets one job. If a section is trying to do two things, cut one. 𝗔𝗽𝗽𝘀 𝘃𝘀 𝗹𝗮𝗻𝗱𝗶𝗻𝗴 𝗽𝗮𝗴𝗲𝘀
For apps and dashboards, different rules apply. Default to Linear-style restraint:
→ Calm surface hierarchy
→ Strong typography and spacing
→ Few colors
→ Dense but readable information
→ Cards only when the card IS the interaction
Avoid dashboard-card mosaics, thick borders on every region, decorative gradients, multiple competing accent colors.
Litmus check: if an operator scans only headings, labels, and numbers — can they understand the page immediately? 𝗠𝗼𝘁𝗶𝗼𝗻: 𝘀𝗵𝗶𝗽 𝟮-𝟯, 𝗻𝗼𝘁 𝟭𝟬
Motion creates presence and hierarchy. Not noise.
Pick three intentional motions and commit to them:
→ One entrance sequence in the hero
→ One scroll-linked or sticky effect
→ One hover, reveal, or layout transition
Framer Motion is the recommended stack. If a motion is only decorative, remove it. 𝗧𝗵𝗲 𝗳𝗿𝗼𝗻𝘁𝗲𝗻𝗱 𝘀𝗸𝗶𝗹𝗹
OpenAI released an open-source skill that encodes all of this into one reusable prompt layer.
Install it with:
$skill-installer frontend-skill
It forces the model to define a visual thesis, content plan, and interaction thesis before touching any code. Worth running before your next build.
𝗧𝗹𝗱𝗿
GPT-5.4 can generate genuinely good frontends. But only when you:
→ Constrain the layout system upfront
→ Give it visual references to work from
→ Structure the page as a narrative, not a document
→ Use real content, not placeholders
→ Keep reasoning low or medium
The model is capable. The prompt is the design brief.
What's the first thing you're building with it? 👇 Full article here:
https://developers.openai.com/blog/designing-delightful-frontends-with-gpt-5-4