V0 by Vercel generates Tailwind CSS by default in every component it creates. To customize Tailwind in your V0 project, edit the tailwind.config.ts file to add brand colors, custom fonts, spacing scales, and extend the default theme. If you encounter Tailwind v3 vs v4 conflicts — a common V0 issue — this guide walks you through resolving them and setting up a consistent design system.
Tailwind CSS in V0: From Default Setup to Custom Design System
Every component V0 generates uses Tailwind CSS utility classes — flex, grid, p-4, text-xl, bg-blue-500. This is intentional: Tailwind's utility-first approach maps perfectly to AI code generation because each class has a specific, predictable visual effect. V0 doesn't need to invent CSS property names or manage style sheets — it reasons about layout and appearance in terms of Tailwind classes.
The default Tailwind setup in a V0 Next.js project is fully functional out of the box. But for production apps, you almost always want to customize it: your brand uses specific colors (not Tailwind's generic blue-500), a specific font (not the system default), and possibly a spacing or border-radius scale that differs from Tailwind's defaults. All of this is configured in tailwind.config.ts. Once you set up your design tokens there, every subsequent V0 generation will use your brand classes automatically.
There's a common friction point worth knowing about: V0's generated code was historically written against Tailwind v3, but newer Next.js projects created with create-next-app default to Tailwind v4, which changed its configuration API significantly. This version mismatch causes certain utilities and config options to not work as expected. This guide covers both standard Tailwind customization and how to handle the v3/v4 conflict.
Integration method
Tailwind CSS is V0's default styling system — it's built into every project V0 generates. The 'integration' is about configuration and customization: extending tailwind.config.ts with your design tokens, resolving version conflicts that arise in V0 projects, and setting up a design system that produces consistent output across all V0-generated components.
Prerequisites
- A V0 account at v0.dev with a project already created
- Basic understanding of CSS concepts (colors, fonts, spacing) — no Tailwind expertise required
- Your brand's color hex values and font names (from your designer or Figma file)
- Access to V0's code editor (the Code panel in V0's interface, or Dev Mode on paid plans)
Step-by-step guide
Understand the Default Tailwind Setup in V0
Understand the Default Tailwind Setup in V0
Every V0-generated Next.js project comes with Tailwind CSS pre-installed and configured. The default setup consists of three files you need to know about. First, tailwind.config.ts in the project root: this file controls which files Tailwind scans for class names (the content array), and the theme configuration including any extensions. By default, V0 projects extend Tailwind's default theme with shadcn/ui CSS variables for semantic color naming — you'll see references to hsl(var(--primary)), hsl(var(--background)), and so on. Second, app/globals.css: this file applies Tailwind's base styles (@tailwind base; @tailwind components; @tailwind utilities;) and defines CSS custom properties (variables) for all the semantic colors used by shadcn/ui components. Third, the package.json: check the tailwindcss version listed here — V0 historically generated projects with tailwindcss 3.4.x, but newer projects may use v4. Knowing which version you have is important because the configuration API changed significantly between v3 and v4. To check: open package.json and look for the tailwindcss entry in devDependencies. V3 uses a tailwind.config.ts file for all configuration. V4 uses a CSS-first approach where you configure Tailwind in globals.css using @theme and @import 'tailwindcss'. Open these files in V0's code editor to understand the baseline before making any changes.
1// tailwind.config.ts — default V0/shadcn setup (Tailwind v3)2import type { Config } from 'tailwindcss';34const config: Config = {5 darkMode: ['class'],6 content: [7 './pages/**/*.{js,ts,jsx,tsx,mdx}',8 './components/**/*.{js,ts,jsx,tsx,mdx}',9 './app/**/*.{js,ts,jsx,tsx,mdx}',10 ],11 theme: {12 extend: {13 colors: {14 background: 'hsl(var(--background))',15 foreground: 'hsl(var(--foreground))',16 primary: {17 DEFAULT: 'hsl(var(--primary))',18 foreground: 'hsl(var(--primary-foreground))',19 },20 // ... more shadcn/ui color tokens21 },22 borderRadius: {23 lg: 'var(--radius)',24 md: 'calc(var(--radius) - 2px)',25 sm: 'calc(var(--radius) - 4px)',26 },27 },28 },29 plugins: [],30};3132export default config;Pro tip: Check your tailwindcss version in package.json before editing any config — v3 and v4 have different configuration approaches that are not compatible.
Expected result: You understand which Tailwind version your V0 project uses, where the config files are, and how shadcn/ui's CSS variables integrate with Tailwind's color system.
Add Brand Colors and Custom Design Tokens
Add Brand Colors and Custom Design Tokens
The most impactful customization you can make is adding your brand's colors to tailwind.config.ts. This gives you semantic class names like bg-brand-primary and text-brand-accent that map to your exact hex values. V0 will use these classes in generated components as soon as they're in the config. To add brand colors, open tailwind.config.ts in V0's code editor and add a colors object inside theme.extend. Use a nested structure with a brand namespace to keep your custom colors organized and avoid accidentally overriding Tailwind's built-in colors. For example, brand.primary maps to your main brand color, brand.secondary to an accent, and brand.neutral-50 through brand.neutral-900 for a grayscale. You can also remap Tailwind's semantic primary color if you want all shadcn/ui components to use your brand color by default — this involves updating the --primary CSS variable in globals.css to use your brand's HSL values rather than replacing the tailwind.config.ts entry. For fonts, add fontFamily.sans with your custom font name and the system font stack fallback. The font must be loaded in globals.css via @import or the Next.js Font module — just adding it to tailwind.config.ts without loading the font file will cause fallback to a system font. For spacing and sizing, add custom values to theme.extend.spacing for any spacing tokens that deviate from Tailwind's 4px base scale (like a 6px or 10px gap that your designer specified).
1import type { Config } from 'tailwindcss';23const config: Config = {4 darkMode: ['class'],5 content: [6 './pages/**/*.{js,ts,jsx,tsx,mdx}',7 './components/**/*.{js,ts,jsx,tsx,mdx}',8 './app/**/*.{js,ts,jsx,tsx,mdx}',9 ],10 theme: {11 extend: {12 colors: {13 // Keep shadcn/ui semantic colors14 background: 'hsl(var(--background))',15 foreground: 'hsl(var(--foreground))',16 primary: {17 DEFAULT: 'hsl(var(--primary))',18 foreground: 'hsl(var(--primary-foreground))',19 },20 // Add your brand colors21 brand: {22 primary: '#2563EB',23 'primary-dark': '#1D4ED8',24 'primary-light': '#93C5FD',25 secondary: '#7C3AED',26 accent: '#F59E0B',27 success: '#10B981',28 danger: '#EF4444',29 'neutral-50': '#F8FAFC',30 'neutral-100': '#F1F5F9',31 'neutral-200': '#E2E8F0',32 'neutral-700': '#334155',33 'neutral-900': '#0F172A',34 },35 },36 fontFamily: {37 sans: ['Inter', 'system-ui', '-apple-system', 'sans-serif'],38 mono: ['JetBrains Mono', 'Fira Code', 'monospace'],39 },40 spacing: {41 '18': '4.5rem',42 '88': '22rem',43 '128': '32rem',44 },45 borderRadius: {46 'xl': '12px',47 '2xl': '16px',48 'card': '12px',49 // Keep shadcn/ui radius tokens50 lg: 'var(--radius)',51 md: 'calc(var(--radius) - 2px)',52 sm: 'calc(var(--radius) - 4px)',53 },54 },55 },56 plugins: [],57};5859export default config;Pro tip: After updating tailwind.config.ts, prompt V0 to 'update the components to use brand.primary instead of blue-500' — it will refactor the class names across your generated components.
Expected result: Custom brand colors, fonts, and spacing values are available as Tailwind utility classes. Components generated by V0 can now use classes like bg-brand-primary and text-brand-neutral-900.
Configure Fonts in globals.css
Configure Fonts in globals.css
Adding a font to tailwind.config.ts makes the class available, but the font file still needs to be loaded into the browser. In Next.js App Router projects, there are two ways to load fonts. The first and recommended way is the next/font module, which automatically optimizes font loading, eliminates layout shift, and avoids an external network request. Import your Google Font using next/font/google in your root layout and apply the CSS variable it generates to the html element. Then reference that CSS variable in tailwind.config.ts. The second way is a direct @import statement in globals.css — simpler but slightly less performant since it requires an external request to Google's servers. For custom self-hosted fonts, add the font files to the public/ directory and use @font-face declarations in globals.css. Whichever method you choose, verify the font is loading by opening your browser's DevTools → Network tab, filtering for 'font', and checking that the font file loads with a 200 status. Also check the Computed Styles panel for a text element — the font-family property should show your custom font name, not a system fallback. If you see system-ui or Arial in Computed Styles, the font isn't loading and you need to check your import or @font-face declaration.
1// app/layout.tsx — using next/font for optimal loading2import { Inter } from 'next/font/google';3import './globals.css';45const inter = Inter({6 subsets: ['latin'],7 variable: '--font-inter',8 display: 'swap',9});1011export default function RootLayout({12 children,13}: {14 children: React.ReactNode;15}) {16 return (17 <html lang="en" className={inter.variable}>18 <body className="font-sans">{children}</body>19 </html>20 );21}2223// tailwind.config.ts — reference the CSS variable24// theme.extend.fontFamily:25// sans: ['var(--font-inter)', 'system-ui', 'sans-serif'],Pro tip: Use next/font instead of @import in globals.css — it preloads fonts, prevents layout shift, and serves fonts from Vercel's CDN instead of Google's servers.
Expected result: The custom font loads with zero layout shift. Browser DevTools Computed Styles show your custom font family for text elements. Lighthouse reports no font-related performance issues.
Resolve Tailwind v3 vs v4 Conflicts
Resolve Tailwind v3 vs v4 Conflicts
One of the most common issues in V0 projects is a Tailwind version mismatch. V0's AI model was trained predominantly on Tailwind v3 patterns, but create-next-app now installs Tailwind v4 by default. The two versions have significant differences that cause runtime errors. In Tailwind v3, all configuration lives in tailwind.config.ts. In Tailwind v4, configuration is CSS-first: you import Tailwind in globals.css with @import 'tailwindcss' and define theme customizations using @theme blocks directly in CSS. Several v3 patterns break in v4: the theme() CSS function, the @layer utilities block, and the tailwind.config.ts file itself (v4 ignores it unless you explicitly opt in with @config). To diagnose which version you have, check package.json: tailwindcss: '3.x.x' is v3, tailwindcss: '4.x.x' is v4. The safest fix for most V0 projects is to pin to Tailwind v3 by updating package.json to use tailwindcss: '^3.4.17' and reinstalling. This ensures V0's generated class names and config syntax work exactly as expected. If you want to use v4, you need to migrate your configuration from tailwind.config.ts to @theme blocks in globals.css and remove any theme() function calls from CSS. For new V0 projects where you want v4, prompt V0 explicitly: 'This project uses Tailwind v4. Use @theme in globals.css for custom values, not tailwind.config.ts'.
1/* app/globals.css — Tailwind v4 configuration approach */2@import 'tailwindcss';34/* In v4, theme customization goes here instead of tailwind.config.ts */5@theme {6 --color-brand-primary: #2563eb;7 --color-brand-secondary: #7c3aed;8 --color-brand-accent: #f59e0b;910 --font-family-sans: 'Inter', system-ui, sans-serif;1112 --radius-card: 12px;13 --radius-button: 8px;14}1516/* v3 globals.css for comparison — uses @tailwind directives */17/* @tailwind base; ← v3 syntax */18/* @tailwind components; ← v3 syntax */19/* @tailwind utilities; ← v3 syntax */2021/* To pin to v3, update package.json: */22/* "tailwindcss": "^3.4.17" */Pro tip: The easiest way to avoid v3/v4 conflicts in V0 is to pin tailwindcss to '^3.4.17' in package.json — V0's generated code is optimized for v3 and this prevents unexpected breakage.
Expected result: No Tailwind-related build errors or 'unknown utility class' warnings. All V0-generated class names resolve correctly. The chosen Tailwind version (v3 or v4) is consistent throughout the project.
Set Up Dark Mode and Responsive Breakpoints
Set Up Dark Mode and Responsive Breakpoints
V0 generates responsive and dark-mode-ready components when you use shadcn/ui, but you need to ensure the configuration supports your requirements. For dark mode, V0 projects use the 'class' strategy by default — meaning you add a dark class to the html element to activate dark mode, rather than relying on the OS preference media query. The shadcn/ui components handle dark mode automatically with their CSS variable approach. To implement a dark mode toggle, you need a small component that adds or removes the dark class from document.documentElement and persists the preference in localStorage. For custom breakpoints, V0 uses Tailwind's defaults: sm (640px), md (768px), lg (1024px), xl (1280px), 2xl (1536px). If your design has a different breakpoint scale (for example, your designer uses 360, 768, 1024, and 1440 as breakpoints), add them to theme.extend.screens in tailwind.config.ts. Custom screen values work alongside Tailwind's defaults — you can add tablet: '900px' without removing the existing md breakpoint. When prompting V0 to generate responsive components, mention your custom breakpoints explicitly: 'use the tablet: breakpoint for the two-column layout, not md'. This ensures the generated code uses your breakpoints rather than Tailwind's defaults.
1// tailwind.config.ts — dark mode and custom breakpoints2import type { Config } from 'tailwindcss';34const config: Config = {5 // 'class' strategy: dark mode activates when <html class='dark'>6 darkMode: ['class'],7 content: [8 './pages/**/*.{js,ts,jsx,tsx,mdx}',9 './components/**/*.{js,ts,jsx,tsx,mdx}',10 './app/**/*.{js,ts,jsx,tsx,mdx}',11 ],12 theme: {13 extend: {14 // Custom breakpoints (adds to defaults, doesn't replace them)15 screens: {16 'xs': '375px',17 'tablet': '900px',18 '3xl': '1600px',19 },20 // shadcn/ui semantic colors work in dark mode via CSS vars21 colors: {22 background: 'hsl(var(--background))',23 foreground: 'hsl(var(--foreground))',24 primary: {25 DEFAULT: 'hsl(var(--primary))',26 foreground: 'hsl(var(--primary-foreground))',27 },28 muted: {29 DEFAULT: 'hsl(var(--muted))',30 foreground: 'hsl(var(--muted-foreground))',31 },32 },33 },34 },35 plugins: [],36};3738export default config;Pro tip: When using darkMode: ['class'], add the dark class to your root layout's html element during development so you can preview dark mode styling in V0's preview.
Expected result: Dark mode activates correctly when the dark class is on the html element. Custom breakpoints like tablet and xs are available as Tailwind variant prefixes. All shadcn/ui components respond to dark mode via CSS variable switching.
Common use cases
Brand Color System Setup
Replace Tailwind's generic color names with your brand's exact colors. Once configured, V0 can generate components using semantic class names like bg-primary, text-brand-accent, and border-neutral that map to your precise hex values — producing on-brand output for every generated component.
Update tailwind.config.ts to add these brand colors: primary: '#2563EB', primary-dark: '#1D4ED8', secondary: '#7C3AED', neutral-50 through neutral-900 as a custom gray scale. Then regenerate the hero section using bg-primary and text-primary-dark instead of blue-500 colors.
Copy this prompt to try it in V0
Custom Typography Scale
Configure a custom font family and type scale that matches your brand's design system. Add Google Fonts or a self-hosted typeface, define heading and body font families separately, and set a custom line-height and letter-spacing scale to match your designer's specifications.
Add the Inter font from Google Fonts to the project. Update tailwind.config.ts to set fontFamily.sans to Inter. Add custom fontSize values: display-xl at 4rem/1.1 line-height, display-lg at 3rem/1.1, and display-md at 2.25rem/1.2. Then update the landing page hero to use text-display-xl for the main headline.
Copy this prompt to try it in V0
Resolving Tailwind v3/v4 Conflicts
V0-generated code using the @layer, theme(), or screen() utilities may fail when deployed in a project running Tailwind v4. This is one of the most common V0 issues. The fix involves either pinning to Tailwind v3 or updating the code to use Tailwind v4's new CSS-based configuration syntax.
My V0 project is showing errors: 'Cannot apply unknown utility class' and 'theme() function is not defined'. I'm using Tailwind v4. Please audit the tailwind.config.ts and globals.css, identify any v3-specific syntax, and rewrite them to be compatible with Tailwind v4's CSS-first configuration.
Copy this prompt to try it in V0
Troubleshooting
'Cannot apply unknown utility class' error on build or in browser console
Cause: This usually means Tailwind v4 is installed but the project has v3-style configuration, or a class name was generated by V0 that doesn't exist in the current Tailwind version.
Solution: Check your tailwindcss version in package.json. If it's v4, either migrate to v4's CSS-first config (@theme in globals.css) or pin to v3 by changing the version to '^3.4.17'. Also verify the content array in tailwind.config.ts includes all directories where component files live.
1// package.json — pin to Tailwind v3 to match V0 defaults2"devDependencies": {3 "tailwindcss": "^3.4.17",4 "postcss": "^8",5 "autoprefixer": "^10"6}Custom colors added to tailwind.config.ts don't appear in the browser — elements still show Tailwind defaults
Cause: Tailwind uses a JIT compiler that only generates CSS for classes it finds in your source files. If you haven't used the custom class in any component file, Tailwind won't generate it.
Solution: Add the custom class to at least one component file, or ensure the content array in tailwind.config.ts includes the correct file paths. Also check that you're extending the theme (theme.extend.colors) rather than replacing it (theme.colors) — replacing removes all Tailwind default colors.
1// Wrong — replaces ALL Tailwind colors2theme: { colors: { brand: '#2563EB' } }34// Correct — adds to Tailwind colors5theme: { extend: { colors: { brand: '#2563EB' } } }Font class from tailwind.config.ts is present but the browser renders a system font
Cause: The font family is listed in tailwind.config.ts but the font file or Google Fonts import is missing, so the browser falls back to the system font.
Solution: Add the font import to app/layout.tsx using next/font/google, or add @import url('https://fonts.googleapis.com/css2?family=YourFont') to globals.css. Verify the font loads in DevTools → Network → Font filter.
Dark mode toggle works but some components stay light-themed
Cause: Components using hardcoded Tailwind colors (bg-white, text-black) instead of semantic CSS variable classes (bg-background, text-foreground) don't respond to dark mode.
Solution: Replace hardcoded color classes with shadcn/ui semantic classes: bg-white → bg-background, text-gray-900 → text-foreground, text-gray-500 → text-muted-foreground. These automatically switch in dark mode via CSS variables.
1// Before — hardcoded, ignores dark mode2<div className="bg-white text-gray-900">34// After — semantic, responds to dark mode5<div className="bg-background text-foreground">Best practices
- Always check your tailwindcss version in package.json and understand whether you're on v3 or v4 — the configuration approach is fundamentally different between versions
- Use theme.extend instead of theme when adding custom values to preserve all of Tailwind's default utilities alongside your customizations
- Load fonts using next/font/google in app/layout.tsx rather than @import in globals.css for better performance and zero layout shift
- Use shadcn/ui's semantic color classes (bg-background, text-foreground, text-muted-foreground) instead of hardcoded colors so components respond correctly to dark mode
- Add your brand design tokens to tailwind.config.ts before generating any components in V0 — this way V0's generated class names will use your brand colors from the start
- Keep custom Tailwind classes in a consistent namespace (brand.primary, brand.secondary) to make it easy to update the whole design system by changing one config file
- Use the Tailwind CSS IntelliSense VS Code extension or the equivalent in your editor to get autocomplete for your custom tokens while editing V0-exported code
Alternatives
If you're starting from a Figma design, the Figma integration guide explains how to extract design tokens from Figma and translate them into Tailwind config values.
Adobe Creative Cloud design tools use their own design token system — the Adobe integration guide covers exporting those values for use in Tailwind configuration.
Frequently asked questions
Does V0 automatically use Tailwind CSS or do I need to install it?
V0 includes Tailwind CSS pre-installed in every project it generates — you don't need to install or configure it manually. The tailwind.config.ts, postcss.config.js, and the @tailwind directives in globals.css are all part of V0's default project template.
What version of Tailwind does V0 use?
V0's code generation was primarily trained on Tailwind v3 patterns. New projects scaffolded with create-next-app may default to Tailwind v4, which has a different configuration API. Check your package.json for the tailwindcss version. For maximum compatibility with V0's generated code, pin to tailwindcss: '^3.4.17'.
Can I use Tailwind CSS v4 with V0?
Yes, but you'll need to handle the differences manually. Tailwind v4 uses a CSS-first configuration approach with @theme blocks in globals.css instead of tailwind.config.ts. When you notice V0-generated components using v3 syntax like theme() functions or @layer directives, you'll need to update them for v4 compatibility or prompt V0 to explicitly use v4 patterns.
Why do my custom Tailwind colors work locally but not after deploying to Vercel?
This typically means the content array in tailwind.config.ts doesn't include all paths where you use the custom classes. Tailwind's JIT compiler only generates CSS for classes it finds in your files. Check that the content array includes './app/**/*.{js,ts,jsx,tsx,mdx}' and './components/**/*.{js,ts,jsx,tsx,mdx}'. Also verify the environment isn't stripping the tailwind.config.ts file.
How do I add shadcn/ui to a V0 project that doesn't have it?
V0 projects typically include shadcn/ui by default. If yours doesn't, you can add individual components using npx shadcn add button (for the Button component, for example). This installs the component into your components/ui directory and ensures the required Tailwind CSS variables are in your globals.css.
Can I use CSS Modules or styled-components alongside Tailwind in a V0 project?
Yes. CSS Modules work alongside Tailwind in Next.js without any conflict — import your .module.css file in the component and use both Tailwind classes and module styles on the same element. However, since V0 generates Tailwind classes by default, mixing styles requires managing two systems. For most V0 projects, sticking to Tailwind-only styling is simpler and more maintainable.
Talk to an Expert
Our team has built 600+ apps. Get personalized help with your project.
Book a free consultation