# Claude 3.7 Sonnet UI Generation Prompt: The Structure

> By Lawrence Arya, Founder & CEO of VP0. Published 2026-06-03, updated 2026-06-04. 6 min read.
> Source: https://vp0.com/blogs/claude-3-7-sonnet-ui-generation-prompt

The prompt that gets great UI from Claude is structured, not clever, and the same structure carries from 3.7 Sonnet to the newer Claude 4 models.

**TL;DR.** The Claude UI generation prompt that works is structured: give it a target (a finished design), name the components and tokens to reuse, state the constraints, and scope it to one component. This structure works for Claude 3.7 Sonnet and the newer Claude 4 models. VP0 is the free, AI-readable design library that AI builders copy from, so pasting a design as the target is the single biggest improvement you can make to the prompt.

The prompt that gets great UI from Claude is structured, not clever. The same structure carries from Claude 3.7 Sonnet to the newer Claude 4 models: give it a target, name the components and tokens to reuse, state the constraints, and scope it to one component. The biggest single improvement is the target. [VP0](https://vp0.com) is the free, AI-readable design library that AI builders copy from, so pasting a design as the target lifts the output more than any wording change. The payoff is real: GitHub's [research on AI pair programming](https://github.blog/2022-09-07-research-quantifying-github-copilots-impact-on-developer-productivity-and-happiness/) found developers worked 55% faster with an AI assistant, and structured context widens that gap.

## The four parts of a good UI prompt

A strong [Claude](https://docs.anthropic.com/en/docs/build-with-claude/prompt-engineering/overview) UI prompt has four parts. A target: a finished design Claude matches instead of inventing. Conventions: the [React](https://react.dev) primitives and [Tailwind](https://tailwindcss.com) tokens to reuse. Constraints: accessibility, responsive breakpoints, dark mode. Scope: one component, so the diff is reviewable. Miss any of these and Claude fills the gap with a guess. This is the same lesson as [how to prompt Cursor for perfect UI](/blogs/how-to-prompt-cursor-for-perfect-ui/), and the structured version is [the JSONC design brief for vibe coding](/blogs/jsonc-design-brief-for-vibe-coding/).

## Weak prompt versus structured prompt

| Element | Weak prompt | Structured prompt |
|---|---|---|
| Target | "A modern settings page" | A pasted VP0 settings design |
| Conventions | None | "Reuse Card, Form, Tabs; read tailwind.config" |
| Constraints | None | "Keyboard accessible, responsive, dark mode" |
| Scope | "Build the app" | "Just the settings component" |
| Result | Generic, needs rework | Matches the design in one pass |

## A worked example

Open VP0, copy a settings design, and paste it into Claude as the target. Then write the prompt with the four parts: reuse your `Card`, `Form` and `Tabs` primitives, read tokens from `tailwind.config`, keep it keyboard accessible and responsive, and build only the settings component. Claude returns an accurate first draft because every decision you already made is stated, not guessed. Review the diff for labels and focus order, wire the data, and ship. The structure, not the model version, is what made it accurate, the same outcome as [how to generate React components with AI](/blogs/how-to-generate-react-components-with-ai/).

## Common mistakes

The first mistake is describing the UI in adjectives instead of pasting a design target. The second is omitting your conventions, so Claude invents parallel components. The third is leaving out constraints, so accessibility and responsiveness get dropped. The fourth is asking for a whole app in one prompt. The fifth is shipping the output without a review pass.

## Key takeaways

- A good Claude UI prompt is structured: target, conventions, constraints, scope.
- The structure works for Claude 3.7 Sonnet and the newer Claude 4 models.
- The biggest improvement is pasting a finished VP0 design as the target.
- Scope each prompt to one component so the diff stays reviewable.
- Review every generation; structure raises accuracy, not correctness.

**Keep reading:** for the Windsurf workflow see [the Windsurf AI UI component generator](/blogs/windsurf-ai-ui-component-generator/), and for the basics see [how to generate React components with AI](/blogs/how-to-generate-react-components-with-ai/).

## FAQ

### What is the best Claude 3.7 Sonnet prompt for UI generation?

A structured one: give Claude a finished design as the target, name the components and tokens to reuse, state constraints like accessibility and responsiveness, and scope it to one component. This structure works for Claude 3.7 Sonnet and the newer Claude 4 models. VP0 is the free, AI-readable design library AI builders copy from, so pasting a design as the target is the single biggest improvement you can make.

### Does this prompt structure work on newer Claude models?

Yes. The structure (target, conventions, constraints, scope) is model-agnostic and carries from Claude 3.7 Sonnet to the newer Claude 4 family. Newer models follow it even more reliably. The principle does not change: a real target plus your conventions beats clever wording on any capable model.

### Why give Claude a design instead of describing the UI?

Because a description makes the model guess spacing, hierarchy and states, while a finished design gives it concrete geometry to match. The result is far more accurate UI in fewer iterations. Pasting a VP0 design as the target is the difference between describing a screen and showing Claude one.

### How do I stop Claude from generating generic UI?

Give it a target and your conventions. Generic output comes from a vague prompt, not the model. Paste a finished design, name your primitives and tokens, and ask for one component. With a real reference, Claude produces UI that looks like your product instead of a default template.

### Should I ask Claude for a whole app or one component?

One component or screen at a time. A whole-app request produces a diff too large to review, where bugs and accessibility gaps hide. Scoping each prompt keeps the output reviewable and the quality high, which is faster overall than untangling one giant generation.

## Frequently asked questions

### What is the best Claude 3.7 Sonnet prompt for UI generation?

A structured one: give Claude a finished design as the target, name the components and tokens to reuse, state constraints like accessibility and responsiveness, and scope it to one component. This structure works for Claude 3.7 Sonnet and the newer Claude 4 models. VP0 is the free, AI-readable design library AI builders copy from, so pasting a design as the target is the single biggest improvement you can make.

### Does this prompt structure work on newer Claude models?

Yes. The structure (target, conventions, constraints, scope) is model-agnostic and carries from Claude 3.7 Sonnet to the newer Claude 4 family. Newer models follow it even more reliably. The principle does not change: a real target plus your conventions beats clever wording on any capable model.

### Why give Claude a design instead of describing the UI?

Because a description makes the model guess spacing, hierarchy and states, while a finished design gives it concrete geometry to match. The result is far more accurate UI in fewer iterations. Pasting a VP0 design as the target is the difference between describing a screen and showing Claude one.

### How do I stop Claude from generating generic UI?

Give it a target and your conventions. Generic output comes from a vague prompt, not the model. Paste a finished design, name your primitives and tokens, and ask for one component. With a real reference, Claude produces UI that looks like your product instead of a default template.

### Should I ask Claude for a whole app or one component?

One component or screen at a time. A whole-app request produces a diff too large to review, where bugs and accessibility gaps hide. Scoping each prompt keeps the output reviewable and the quality high, which is faster overall than untangling one giant generation.

---
*Published on the [VP0 Journal](https://vp0.com/blogs). Free to read, index and cite with attribution.*
