AD SPACE AVAILABLE · BRAND PARTNERS WELCOME

How to Customize Prompt Design in v0 for Existing Design System Tokens

Jean-Benoît Doazan · 365Finds Editorial
Indexed 88,650 Wiki articles

Put 365 Wiki to work with your AI

Copy the prompt below, paste it into the AI you already use, then ask your question.

Download full Skill

Try it with the prompt first. If you use 365 Wiki often, install the full 365Wiki Skill so you do not have to paste it again. No regular AI? Gemini or Microsoft Copilot on the web will work.

365Wiki Skill

Generating UI with AI feels magical until you copy the code into your repository and realize it takes forty minutes to untangle arbitrary hex codes, foreign spacing scales, and bespoke buttons. v0 by Vercel excels at assembling React and Tailwind layouts in seconds. But by default, v0 behaves like a freelancer who never read your brand guidelines: it defaults to literal utility classes (bg-blue-600, text-gray-900, rounded-xl) and reinvents baseline primitives instead of reusing your existing components.

At 365Finds, our stance is straightforward: if an AI code generation tool forces your engineering team to spend more time refactoring classes than writing logic, it is failing at its core commercial value proposition. To make v0 respect your design tokens and naming conventions, you cannot rely on casual conversational English. You must treat prompt architecture as an engineering interface.

Here is how we configure v0 to consistently adhere to existing design system tokens, CSS variables, and component conventions—and where the system still requires strict guardrails.


Why v0 Drifts Away from Your Design Tokens

To fix token drift, you have to understand what causes it.

v0 is tuned heavily on the standard shadcn/ui ecosystem, Next.js App Router patterns, and raw Tailwind CSS. When you give v0 a generic prompt like "Create a user profile billing card", its underlying model predicts tokens based on the vast sea of public Tailwind code. It picks bg-white, border-gray-200, and rounded-lg because those are statistically dominant in its training corpus.

If your design system uses semantic variables (such as bg-card, text-muted-foreground, or custom tokens like var(--brand-primary) and rounded-subtle), v0 will ignore them unless you explicitly:

  1. Strip away its default preference for literal color utilities.
  2. Provide a strict semantic dictionary directly in the context.
  3. Lock down component invocation syntax using existing primitives rather than raw HTML tags.

The Three-Tier Prompt Injection Architecture

Relying on a single massive prompt every time you ask for a component is exhausting and error-prone. At 365Finds, we structure prompt constraints across three distinct tiers:

┌────────────────────────────────────────────────────────┐
│ Tier 1: Persistent Workspace Rules                     │
│ (v0 Custom Instructions / Project Knowledge)           │
├────────────────────────────────────────────────────────┤
│ Tier 2: Component & Token Contract                    │
│ (Semantic mapping, CSS variables, forbidden classes)   │
├────────────────────────────────────────────────────────┤
│ Tier 3: Feature Task Prompt                            │
│ (Specific UI layout, mock data, interaction states)    │
└────────────────────────────────────────────────────────┘

1. Tier 1: Workspace & Project Knowledge (Set Once)

Do not paste your whole tailwind.config.ts into every single prompt message. Instead, place persistent rules into v0's Custom Instructions (under Account Settings) or inside Project Knowledge (Project -> Knowledge):

2. Tier 2: The Semantic Token and Primitive Contract

Before asking for a screen, define your project's design vocabulary. If you are using shadcn/ui or CSS variables in Tailwind, summarize your active tokens in a clean, tokenized contract block.

3. Tier 3: The Feature Task Prompt

This is where you describe the actual widget or screen. Because Tier 1 and Tier 2 provide the stylistic boundaries, your task prompt can focus cleanly on user flows, accessibility, and hierarchy.


The Master Production Prompt Template

Here is the exact prompt structure 365Finds recommends using when initiating a UI task where token fidelity is mandatory:

### System Context & Design System Contract
You are building production React (TypeScript) components. You must strictly adhere to our custom design system tokens and conventions.

#### 1. Forbidden Classes (Negative Rules)
- DO NOT use literal colors: `bg-white`, `bg-black`, `text-gray-*`, `border-slate-*`, `bg-blue-*`.
- DO NOT use hardcoded hex values or arbitrary Tailwind brackets (e.g., `bg-[#1a1a1a]`, `w-[320px]`).
- DO NOT write raw HTML `<button>`, `<input>`, or `<select>` tags when an existing UI primitive exists.

#### 2. Mandatory Semantic Tokens
Map all styling strictly to our CSS variable utility tokens:
- Canvas & Surfaces: `bg-background`, `bg-card`, `bg-muted`, `bg-popover`
- Typography: `text-foreground`, `text-muted-foreground`, `text-primary`, `text-card-foreground`
- Borders & Dividers: `border-border`, `divide-border`
- Interactive & Brand: `bg-primary text-primary-foreground`, `bg-secondary text-secondary-foreground`, `hover:bg-accent hover:text-accent-foreground`
- Form States: `border-input`, `ring-ring`, `focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2`
- Radii: strictly adhere to `rounded-md` (cards) and `rounded-sm` (buttons/inputs). Never use `rounded-2xl` or `rounded-full` (except circular avatars).

#### 3. Component Reusability & Imports
Assume standard `@/components/ui/*` path aliases:
- Use `<Button variant="default | outline | secondary | ghost" size="sm | default | lg">`
- Use `<Badge variant="outline | secondary">`
- Use `<Card>`, `<CardHeader>`, `<CardTitle>`, `<CardContent>`, `<CardFooter>`
- Icons: Import strictly from `lucide-react` using `className="h-4 w-4"` or `className="size-4"`.

---

### UI Task Request
Build a responsive "API Usage & Billing Quota" card. It should show:
- Monthly plan name with an active badge.
- Progress bar displaying consumed API units versus total quota.
- Cost estimate calculation.
- An alert box warning the user if usage exceeds 85%.
- Upgrade CTA button and a secondary link to view raw usage logs.

Concrete Comparison: Good Prompting vs. Default Output

To see the real-world impact on code maintenance, compare the component code generated under default conditions versus our constrained contract:

DimensionDefault Unconstrained v0 PromptStructured Token-Constrained v0 Prompt
Surface StylingclassName="bg-white border border-gray-200 shadow-sm"className="bg-card text-card-foreground border-border shadow-sm"
Text HierarchyclassName="text-gray-900 font-bold", text-gray-500className="text-foreground font-semibold", text-muted-foreground
Dark Mode SupportBroken. Requires manual addition of dark:bg-slate-900Native. Follows CSS variables automatically across themes
Button Implementation<button className="bg-blue-600 px-4 py-2 text-white"><Button variant="default">Upgrade Plan</Button>
Maintenance OverheadHigh; full manual regex or refactor requiredMinimal; ready to paste directly into your Next.js repo

Managing Multi-Turn Iteration Without "Token Drift"

One of v0's most frustrating habits is context regression. In prompt 1, it follows your tokens faithfully. By prompt 3 (e.g., "Make the card look a bit warmer and add a badge"), v0 forgets the negative constraints and introduces bg-amber-50 or text-amber-700.

To prevent this drift across chat revisions:

  1. Avoid purely visual descriptions: Never say "Make the button darker blue." Say "Switch the button variant to default with bg-primary."
  2. Anchor the token constraint in your feedback: When requesting a revision, include a one-line reminder: "Ensure all additions continue to use exclusively semantic tokens (border-border, bg-muted) without literal color utilities."
  3. Use v0's Inline Editing / Selector Tool: Rather than asking the conversational model to rewrite the entire component tree, highlight the specific JSX block and prompt only on that fragment. This prevents the model from regenerating the entire file and re-introducing bad classes elsewhere.

The Realistic Limits: What v0 Still Cannot Do

365Finds does not believe in AI hype that ignores developer friction. While v0 can adhere remarkably well to Tailwind-based semantic tokens, it has clear structural limitations:


365Finds Recommendation: Establish a Three-Step Workflow

If your engineering organization is adopting v0 to accelerate frontend delivery, here is our operational verdict:

  1. Document your design tokens in llms.txt or a markdown cheat sheet: Keep a clean, 50-line summary of your theme tokens, radius scales, and core component signatures. Store this in your repository and copy it directly into v0 Project Knowledge.
  2. Treat Negative Prompting as mandatory: AI models respond better to explicit exclusions than polite suggestions. Banning bg-white and hardcoded colors is 80% of the battle.
  3. Run automated linter gates upon export: Do not rely on human memory. Set up an ESLint rule (such as no-restricted-syntax or Tailwind CSS linting plugins) in your CI pipeline that fails the build if literal utility colors are committed to feature branches.

By treating v0 not as an autonomous designer, but as a rapid scaffolding engine governed by strict token contracts, you eliminate hours of wasted refactoring and keep your codebase consistent.


References