TL;DR: I already have a design system in Figma (tokens + components). I want v0 to generate into that system—using my tokens and component library—so it doesn’t reinvent unstyled/brandless UI. What’s the best strategy you’ve used to make this stick?
Context
-
I’m exploring v0 for a product and want it to be “style-aware.”
-
Tokens + styles live in Figma (colors, type scale, spacing, radii, shadows).
-
On the code side I’m using Tailwind + CSS variables + shadcn/radix-style primitives (happy to adapt if there’s a cleaner pattern).
Desired outcome
-
v0 outputs import my components (e.g., import { Button } from “@/components/ui/button”), not raw HTML.
-
All spacing/typography/colors come from my tokens (Tailwind theme or CSS vars).
-
Zero inline styles. No ad-hoc classes that drift from the system.
What I’m thinking
-
Seed repo strategy
-
Provide v0 a starter repo that includes:
-
tokens.css (CSS vars) and/or tailwind.config.js with my tokens.
-
A documented component library (/components/ui/*) that wraps primitives and encodes variants.
-
ESLint/Stylelint rules to forbid inline styles + non-token color/spacing.
-
A short CONTRIBUTING.md with code “recipes” (e.g., “use for tertiary actions”).
-
-
Prompt v0 with “always import from /components/ui and use Tailwind tokens only.”
-
-
Few-shot component mapping
-
Give v0 examples like:
-
“When you need a primary CTAs, use .”
-
“Lists use ; tables use ; never DIY divs.”
-
-
Include 3–5 realistic patterns (card, form, table, modal, empty state) as reference.
-
-
Token sync
-
Export Figma tokens → JSON (Tokens Studio / Design Tokens plugin) → build CSS vars + Tailwind theme via Style Dictionary (or similar).
-
Keep a one-command sync (pnpm tokens:sync) so design changes flow through.
-
-
Guardrails
-
ESLint rule to ban style={{…}} and non-token colors.
-
CI check that fails on unknown classes or raw hex values.
-
(Optional) visual tests to catch drift.
-
Questions for folks who’ve done this
-
What’s your most reliable way to make v0 consistently import your components instead of emitting raw markup?
-
Have you had better results with CSS variables first (then Tailwind maps) vs Tailwind-only tokens?
-
How do you pass the “component dictionary” to v0 so it learns that “button = @/components/ui/button with variants”?
-
Any lightweight “lint rules” or codemods you use to auto-correct v0 output back into system-compliant code?
-
If you’re using shadcn/radix: did you keep them as internal primitives and expose a branded layer, or let v0 touch shadcn directly?
-
Bonus: examples of public repos or prompts that made this work reliably.
Happy to share back a minimal template (tokens → CSS vars + Tailwind, component wrappers, lint rules, and prompt snippets) once I firm up a good pattern.
Thanks!