v0 - Kompletny przewodnik po generatorze UI od Vercel, który zmienia sposób tworzenia interfejsów
Czym jest v0 i dlaczego rewolucjonizuje front-end development?
v0 to przełomowe narzędzie AI stworzone przez Vercel - firmę odpowiedzialną za Next.js. Pozwala generować kompletne komponenty React, całe strony i złożone interfejsy użytkownika wyłącznie z opisów tekstowych. W przeciwieństwie do tradycyjnego podejścia, gdzie developer musi ręcznie pisać każdą linię kodu HTML, CSS i JavaScript, v0 automatyzuje ten proces, generując produkcyjnej jakości kod w sekundy.
To nie jest kolejny generator wireframe'ów czy prototypów - v0 tworzy prawdziwy, działający kod React z Tailwind CSS i komponentami shadcn/ui, który można bezpośrednio skopiować do projektu i użyć w produkcji.
Dlaczego v0 jest tak popularne?
Jakość generowanego kodu
v0 nie tworzy "demo code" ani prototypów - generuje kod produkcyjnej jakości:
// Wygenerowany przez v0 komponent karty produktu
import { Card, CardContent, CardFooter, CardHeader, CardTitle } from "@/components/ui/card"
import { Button } from "@/components/ui/button"
import { Badge } from "@/components/ui/badge"
import { Star, ShoppingCart } from "lucide-react"
interface ProductCardProps {
name: string
price: number
rating: number
image: string
category: string
inStock: boolean
}
export function ProductCard({ name, price, rating, image, category, inStock }: ProductCardProps) {
return (
<Card className="w-full max-w-sm overflow-hidden transition-shadow hover:shadow-lg">
<div className="relative aspect-square overflow-hidden">
<img
src={image}
alt={name}
className="h-full w-full object-cover transition-transform hover:scale-105"
/>
{!inStock && (
<div className="absolute inset-0 flex items-center justify-center bg-black/50">
<Badge variant="destructive">Wyprzedane</Badge>
</div>
)}
</div>
<CardHeader className="space-y-1">
<div className="flex items-center justify-between">
<Badge variant="secondary">{category}</Badge>
<div className="flex items-center gap-1">
<Star className="h-4 w-4 fill-yellow-400 text-yellow-400" />
<span className="text-sm font-medium">{rating}</span>
</div>
</div>
<CardTitle className="line-clamp-2">{name}</CardTitle>
</CardHeader>
<CardContent>
<p className="text-2xl font-bold">{price.toFixed(2)} zł</p>
</CardContent>
<CardFooter>
<Button className="w-full" disabled={!inStock}>
<ShoppingCart className="mr-2 h-4 w-4" />
Dodaj do koszyka
</Button>
</CardFooter>
</Card>
)
}Szybkość iteracji
Tradycyjnie stworzenie takiego komponentu zajęłoby 30-60 minut. Z v0 to kwestia jednego promptu i ewentualnych iteracji. Cały proces od pomysłu do działającego kodu trwa minuty.
Nauka przez przykład
v0 to także świetne narzędzie edukacyjne. Analizując wygenerowany kod, uczysz się:
- Best practices Tailwind CSS
- Wzorców kompozycji komponentów
- Użycia biblioteki shadcn/ui
- Struktury responsywnych layoutów
Jak zacząć z v0?
Krok 1: Rejestracja
- Wejdź na v0.dev
- Zaloguj się kontem Vercel, GitHub lub email
- Otrzymujesz automatycznie darmowe kredyty na start
Krok 2: Pierwszy prompt
Wpisz opis komponentu w polu tekstowym. Im bardziej szczegółowy prompt, tym lepszy wynik:
❌ Prosty prompt (słaby wynik):
"Stwórz formularz"
✅ Szczegółowy prompt (świetny wynik):
"Stwórz formularz kontaktowy z polami: imię, email, temat (dropdown:
Zapytanie, Wsparcie, Współpraca), wiadomość (textarea). Dodaj walidację
inline, przycisk submit z loading state, i dark mode support. Użyj
shadcn/ui components z subtle animations."Krok 3: Iteracja
Po wygenerowaniu kodu możesz:
- Modyfikować prompt - "Dodaj pole numeru telefonu"
- Używać Visual Controls - Precyzyjnie dostosować kolory, spacing
- Prosić o warianty - "Stwórz wersję z wieloetapowym formularzem"
Krok 4: Eksport do projektu
# Opcja 1: Skopiuj kod bezpośrednio
# Kliknij "Copy Code" i wklej do swojego projektu
# Opcja 2: Użyj npx do instalacji komponentu
npx v0@latest add <component-url>
# Opcja 3: Integracja z projektem Next.js
# W projekcie Next.js możesz bezpośrednio importować z v0Zaawansowane techniki promptowania
Struktura idealnego promptu
## Szablon promptu v0
[TYP KOMPONENTU]: Co tworzysz (karta, formularz, dashboard)
[ZAWARTOŚĆ]: Jakie elementy zawiera
[FUNKCJONALNOŚĆ]: Jakie interakcje
[STYL]: Estetyka, motyw, kolorystyka
[TECHNOLOGIA]: shadcn/ui, Tailwind, React hooks
[DODATKOWE]: Dark mode, animacje, responsywnośćPrzykłady skutecznych promptów
Landing Page SaaS
Create a modern SaaS landing page with:
HERO SECTION:
- Gradient background (purple to blue)
- Large headline with typing animation effect
- Subheadline explaining the product value
- Two CTAs: "Start Free Trial" (primary) and "Watch Demo" (secondary/outline)
- Floating dashboard mockup image with shadow
FEATURES SECTION:
- 3 columns grid with icons
- Each feature: icon, title, description
- Subtle hover animation on cards
PRICING:
- 3 tier cards: Free, Pro, Enterprise
- Monthly/Annual toggle
- Highlighted "Most Popular" badge on Pro
- Feature comparison list
TESTIMONIALS:
- Carousel with customer quotes
- Avatar, name, company, quote
FOOTER:
- 4 column links layout
- Newsletter subscription
- Social media icons
Use shadcn/ui components, Tailwind CSS, smooth scroll,
and ensure full dark mode support.Dashboard Analityczny
Build an analytics dashboard with:
SIDEBAR:
- Logo at top
- Navigation: Dashboard, Analytics, Users, Settings, Reports
- Icons from lucide-react
- Collapsible on mobile
- Active state indicator
- User avatar and dropdown at bottom
MAIN CONTENT:
- Header with search, notifications bell, user menu
- Stats row: 4 metric cards (users, revenue, orders, conversion)
- Each with icon, value, percentage change, sparkline chart
- Charts section:
- Revenue over time (area chart)
- Traffic sources (pie chart)
- Recent activity table:
- Columns: User, Action, Date, Status
- Pagination
- Sort functionality
- Status badges (Completed, Pending, Failed)
Use Recharts for charts, shadcn/ui for components,
framer-motion for subtle animations.E-commerce Product Page
Design a product page for an e-commerce fashion store:
GALLERY:
- Main image with zoom on hover
- Thumbnail strip below (5 images)
- Click thumbnail to change main image
- Lightbox view on click
PRODUCT INFO:
- Breadcrumbs navigation
- Product title (large)
- Star rating with review count
- Price with strikethrough original price
- Color swatches (clickable)
- Size selector (S, M, L, XL) with size guide link
- Quantity selector
- Add to cart button (full width)
- Wishlist heart icon
TABS BELOW:
- Description
- Specifications (table format)
- Reviews (list with pagination)
RELATED PRODUCTS:
- Horizontal scrollable row
- 4 product cards visible
Mobile-first, fast loading, accessible.Integracja z Next.js
Instalacja komponentów z v0
# Najpierw skonfiguruj shadcn/ui w projekcie
npx shadcn@latest init
# Zainstaluj wymagane zależności
npm install @radix-ui/react-icons lucide-react
# Dodaj komponenty wygenerowane przez v0
npx v0@latest add https://v0.dev/chat/b/xxxxxStruktura projektu z v0
src/
├── app/
│ ├── page.tsx # Używa komponentów z v0
│ └── dashboard/
│ └── page.tsx
├── components/
│ ├── ui/ # shadcn/ui base components
│ │ ├── button.tsx
│ │ ├── card.tsx
│ │ └── ...
│ └── v0/ # Komponenty wygenerowane przez v0
│ ├── hero-section.tsx
│ ├── pricing-cards.tsx
│ └── feature-grid.tsx
├── lib/
│ └── utils.ts # cn() helper z shadcn
└── styles/
└── globals.css # Tailwind + shadcn stylesDostosowywanie wygenerowanego kodu
v0 generuje kod który można łatwo rozszerzyć:
// Oryginalny komponent z v0
export function FeatureCard({ title, description, icon }: FeatureCardProps) {
return (
<Card>
<CardHeader>
{icon}
<CardTitle>{title}</CardTitle>
</CardHeader>
<CardContent>
<p>{description}</p>
</CardContent>
</Card>
)
}
// Twoje rozszerzenie z dodatkowymi funkcjami
export function FeatureCard({
title,
description,
icon,
href, // Dodane
onClick, // Dodane
isLoading // Dodane
}: ExtendedFeatureCardProps) {
const content = (
<Card className={cn(
"transition-all duration-200",
href && "cursor-pointer hover:shadow-lg hover:-translate-y-1",
isLoading && "opacity-50 pointer-events-none"
)}>
<CardHeader>
{isLoading ? <Skeleton className="h-8 w-8" /> : icon}
<CardTitle>{title}</CardTitle>
</CardHeader>
<CardContent>
<p>{description}</p>
</CardContent>
</Card>
)
if (href) {
return <Link href={href}>{content}</Link>
}
if (onClick) {
return <button onClick={onClick}>{content}</button>
}
return content
}Visual Controls - Precyzyjna edycja
Dostępne kontrolki
Po wygenerowaniu komponentu v0 oferuje Visual Controls:
Colors - Zmiana palety kolorów
- Primary, Secondary, Accent
- Background, Foreground
- Border, Muted colors
Typography - Czcionki i rozmiary
- Font family
- Heading sizes (h1-h6)
- Body text size
- Line height, letter spacing
Spacing - Odstępy
- Padding (inner)
- Margin (outer)
- Gap (between elements)
Layout - Układ
- Flex direction
- Grid columns
- Alignment
- Justify content
Effects - Efekty
- Border radius
- Shadow
- Opacity
- Blur
Workflow z Visual Controls
1. Wygeneruj komponent promptem
2. Użyj Visual Controls do dostrojenia
3. Sprawdź preview na różnych breakpoints
4. Kliknij "View Code" aby zobaczyć zmiany
5. Eksportuj finalny kodMulti-Framework Support
v0 obsługuje wiele frameworków:
React (domyślnie)
// Domyślny output - React + Tailwind + shadcn/ui
export function Button({ children, variant = "default" }) {
return (
<button className={cn(
"px-4 py-2 rounded-md font-medium",
variant === "default" && "bg-primary text-primary-foreground",
variant === "outline" && "border border-input"
)}>
{children}
</button>
)
}Vue
<!-- Vue output -->
<template>
<button :class="buttonClasses">
<slot />
</button>
</template>
<script setup>
import { computed } from 'vue'
const props = defineProps({
variant: {
type: String,
default: 'default'
}
})
const buttonClasses = computed(() => [
'px-4 py-2 rounded-md font-medium',
props.variant === 'default' && 'bg-primary text-primary-foreground',
props.variant === 'outline' && 'border border-input'
])
</script>Svelte
<!-- Svelte output -->
<script>
export let variant = 'default'
$: buttonClasses = [
'px-4 py-2 rounded-md font-medium',
variant === 'default' && 'bg-primary text-primary-foreground',
variant === 'outline' && 'border border-input'
].filter(Boolean).join(' ')
</script>
<button class={buttonClasses}>
<slot />
</button>HTML/CSS (Vanilla)
<!-- Vanilla HTML output -->
<button class="btn btn-default">
Click me
</button>
<style>
.btn {
padding: 0.5rem 1rem;
border-radius: 0.375rem;
font-weight: 500;
}
.btn-default {
background-color: var(--primary);
color: var(--primary-foreground);
}
.btn-outline {
border: 1px solid var(--border);
}
</style>AutoFix - Automatyczna naprawa błędów
v0 automatycznie wykrywa i naprawia typowe problemy:
Przykłady AutoFix
// Problem: Brakujący import
// v0 automatycznie dodaje:
import { useState } from 'react'
// Problem: Niezdefiniowany typ
// v0 generuje interface:
interface CardProps {
title: string
description: string
}
// Problem: Accessibility
// v0 dodaje odpowiednie atrybuty:
<button aria-label="Close dialog">
<X className="h-4 w-4" />
</button>
// Problem: Responsywność
// v0 dodaje breakpointy:
<div className="grid grid-cols-1 md:grid-cols-2 lg:grid-cols-3">Cennik v0 (2025)
System kredytów
v0 używa systemu kredytów tokenowych:
| Plan | Cena | Kredyty | Idealne dla |
|---|---|---|---|
| Free | $0 | $5/miesiąc | Testowanie, nauka |
| Premium | $20/mies. | $20/miesiąc | Indywidualni developerzy |
| Team | $30/użytk./mies. | Shared pool | Zespoły, agencje |
Ile kosztuje generowanie?
- Prosty komponent (Button, Card): ~$0.10-0.20
- Średni komponent (Form, Modal): ~$0.30-0.50
- Złożony komponent (Dashboard section): ~$0.50-1.00
- Cała strona: ~$1.00-3.00
Optymalizacja kosztów
- Pisz szczegółowe prompty - Mniej iteracji = mniej kredytów
- Używaj templates - v0 oferuje gotowe szablony jako punkt startowy
- Iteruj selektywnie - Modyfikuj tylko potrzebne sekcje
- Eksportuj i edytuj lokalnie - Drobne zmiany rób w IDE
v0 vs Alternatywy
v0 vs GitHub Copilot
| Aspekt | v0 | GitHub Copilot |
|---|---|---|
| Podejście | Prompt → gotowy komponent | Inline suggestions |
| Kontekst | Pojedynczy prompt | Cały plik/projekt |
| Output | Kompletne komponenty | Fragmenty kodu |
| Visual editing | Tak | Nie |
| Najlepsze do | UI generation | General coding |
v0 vs Cursor Composer
| Aspekt | v0 | Cursor Composer |
|---|---|---|
| Specjalizacja | UI/Frontend | Dowolny kod |
| Środowisko | Web browser | IDE (VS Code fork) |
| Integracja | shadcn/ui native | Dowolne biblioteki |
| Multi-file | Nie | Tak |
| Najlepsze do | Komponenty React | Pełne projekty |
v0 vs Figma + Dev Mode
| Aspekt | v0 | Figma Dev Mode |
|---|---|---|
| Workflow | Prompt → Code | Design → Code |
| Wymaga designu | Nie | Tak |
| Jakość CSS | Tailwind (production) | Inline styles (basic) |
| Interaktywność | Pełna (React) | Statyczny HTML |
| Najlepsze do | Rapid prototyping | Design handoff |
Praktyczne scenariusze użycia
Scenariusz 1: Startup MVP
Masz 2 tygodnie na MVP. Jak użyć v0?
Dzień 1-2: Landing page
- v0: "SaaS landing page with waitlist signup"
- Dostosuj branding w Visual Controls
- Eksportuj do Next.js
Dzień 3-5: Dashboard
- v0: "Admin dashboard with user management"
- Dodaj własną logikę biznesową
- Podłącz do API
Dzień 6-7: Onboarding
- v0: "Multi-step onboarding wizard"
- Zintegruj z auth (Clerk/NextAuth)
Efekt: Profesjonalny UI w tydzień zamiast miesiącaScenariusz 2: Design System
Budujesz design system dla firmy:
1. Wygeneruj bazowe komponenty w v0:
- Button (all variants)
- Input, Select, Checkbox
- Card, Modal, Toast
- Table, Pagination
2. Dostosuj do brand guidelines:
- Kolory firmowe
- Typografia
- Spacing system
3. Eksportuj jako bibliotekę:
- Stwórz package npm
- Dokumentacja Storybook
- Testy jednostkowe
Efekt: Spójny design system w dni zamiast tygodniScenariusz 3: Freelancer
Klient potrzebuje quick mockup:
1. Prompt na podstawie briefu
2. 15 minut iteracji
3. Live preview dla klienta
4. Feedback → kolejne iteracje
5. Eksport po akceptacji
Efekt: Mockup w godzinę, implementacja w dzieńTips & Best Practices
Do's
✅ Pisz szczegółowe prompty z kontekstem
✅ Używaj nazw komponentów shadcn/ui w promptach
✅ Iteruj małymi krokami
✅ Sprawdzaj accessibility wygenerowanego kodu
✅ Dostosowuj kod do swoich konwencji po eksporcie
✅ Ucz się z wygenerowanego koduDon'ts
❌ Nie kopiuj kodu bez przeglądu
❌ Nie ignoruj TypeScript warnings
❌ Nie używaj v0 do logiki biznesowej
❌ Nie oczekuj perfekcji za pierwszym razem
❌ Nie używaj zbyt ogólnych promptówPrompt Engineering Tips
## Struktura skutecznego promptu
1. KONTEKST - Czym jest projekt
"For a healthcare SaaS dashboard..."
2. KOMPONENTY - Co używać
"Using shadcn/ui Card, Button, and Table..."
3. FUNKCJONALNOŚĆ - Co robi
"That displays patient list with search, sort, and pagination..."
4. STYL - Jak wygląda
"Clean, minimal design with blue accent color..."
5. ZACHOWANIA - Interakcje
"With hover states, loading skeletons, and empty states..."
6. TECHNICZNE - Wymagania
"Fully accessible, dark mode support, mobile responsive..."Integracja z workflow
v0 + Cursor
# 1. Wygeneruj komponent w v0
# 2. Eksportuj kod
# 3. Wklej do Cursor
# 4. Użyj Cursor AI do rozszerzenia:
"Add unit tests for this component"
"Create a Storybook story"
"Add form validation with Zod"v0 + Storybook
// Po eksporcie z v0, dodaj story:
import type { Meta, StoryObj } from '@storybook/react'
import { ProductCard } from './ProductCard'
const meta: Meta<typeof ProductCard> = {
title: 'Components/ProductCard',
component: ProductCard,
tags: ['autodocs'],
}
export default meta
type Story = StoryObj<typeof ProductCard>
export const Default: Story = {
args: {
name: 'Product Name',
price: 99.99,
rating: 4.5,
image: '/placeholder.jpg',
category: 'Electronics',
inStock: true,
},
}
export const OutOfStock: Story = {
args: {
...Default.args,
inStock: false,
},
}v0 + GitHub Actions
# .github/workflows/v0-components.yml
name: Track v0 Components
on:
push:
paths:
- 'src/components/v0/**'
jobs:
document:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Generate component docs
run: |
# Track which v0 components are used
find src/components/v0 -name "*.tsx" | wc -lFAQ - Najczęściej zadawane pytania
Czy v0 zastąpi front-end developerów?
Nie. v0 to narzędzie przyspieszające pracę, nie zastępujące. Developer nadal musi:
- Pisać logikę biznesową
- Integrować z API
- Optymalizować performance
- Dbać o accessibility
- Testować i debugować
v0 automatyzuje najbardziej powtarzalne zadania (pisanie JSX, Tailwind classes), pozwalając skupić się na tym, co naprawdę ważne.
Jak v0 radzi sobie z custom design systems?
v0 domyślnie używa shadcn/ui, ale możesz:
- Dostosować theme przez Visual Controls
- Modyfikować wygenerowany kod
- Opisać swój design system w prompcie
"Use my company design system colors:
- Primary: #1a365d (navy blue)
- Secondary: #ed8936 (orange)
- Background: #f7fafc (light gray)
And 8px spacing grid"Czy kod z v0 jest production-ready?
W większości tak. v0 generuje:
- Poprawny TypeScript
- Accessible HTML
- Responsywne style
Jednak zawsze przejrzyj kod pod kątem:
- Performance (lazy loading, memoization)
- Security (user input handling)
- Edge cases (loading, error states)
Jak radzić sobie z limitami kredytów?
- Pisz precyzyjne prompty - Mniej iteracji
- Używaj templates - Oszczędzają kredyty
- Eksportuj wcześnie - Drobne edycje rób lokalnie
- Team plan - Shared credits dla zespołu
Czy mogę używać v0 do komercyjnych projektów?
Tak. Wygenerowany kod jest Twój i możesz go używać w projektach komercyjnych bez ograniczeń.
Podsumowanie
v0 to game-changer dla front-end development. Łączy moc AI z jakością shadcn/ui i ekosystemem Vercel, tworząc narzędzie które:
- Przyspiesza development - Komponenty w minuty zamiast godzin
- Podnosi jakość - Produkcyjny kod z best practices
- Uczy dobrych wzorców - Analizuj wygenerowany kod
- Integruje się z workflow - Next.js, Cursor, Storybook
Czy to dla Ciebie? Jeśli tworzysz interfejsy React/Next.js, v0 to must-have w toolboxie. Darmowy tier pozwala przetestować możliwości, a dla profesjonalistów $20/miesiąc to inwestycja zwracająca się w ciągu pierwszego dnia pracy.
v0 - Complete guide to Vercel's UI generator that changes the way interfaces are built
What is v0 and why does it revolutionize front-end development?
v0 is a groundbreaking AI tool created by Vercel - the company behind Next.js. It lets you generate complete React components, entire pages, and complex user interfaces purely from text descriptions. Unlike the traditional approach where a developer has to manually write every line of HTML, CSS, and JavaScript, v0 automates this process, generating production-quality code in seconds.
This is not just another wireframe or prototype generator - v0 creates real, working React code with Tailwind CSS and shadcn/ui components that you can copy directly into your project and use in production.
Why is v0 so popular?
Quality of generated code
v0 does not create "demo code" or prototypes - it generates production-quality code:
// Product card component generated by v0
import { Card, CardContent, CardFooter, CardHeader, CardTitle } from "@/components/ui/card"
import { Button } from "@/components/ui/button"
import { Badge } from "@/components/ui/badge"
import { Star, ShoppingCart } from "lucide-react"
interface ProductCardProps {
name: string
price: number
rating: number
image: string
category: string
inStock: boolean
}
export function ProductCard({ name, price, rating, image, category, inStock }: ProductCardProps) {
return (
<Card className="w-full max-w-sm overflow-hidden transition-shadow hover:shadow-lg">
<div className="relative aspect-square overflow-hidden">
<img
src={image}
alt={name}
className="h-full w-full object-cover transition-transform hover:scale-105"
/>
{!inStock && (
<div className="absolute inset-0 flex items-center justify-center bg-black/50">
<Badge variant="destructive">Sold Out</Badge>
</div>
)}
</div>
<CardHeader className="space-y-1">
<div className="flex items-center justify-between">
<Badge variant="secondary">{category}</Badge>
<div className="flex items-center gap-1">
<Star className="h-4 w-4 fill-yellow-400 text-yellow-400" />
<span className="text-sm font-medium">{rating}</span>
</div>
</div>
<CardTitle className="line-clamp-2">{name}</CardTitle>
</CardHeader>
<CardContent>
<p className="text-2xl font-bold">${price.toFixed(2)}</p>
</CardContent>
<CardFooter>
<Button className="w-full" disabled={!inStock}>
<ShoppingCart className="mr-2 h-4 w-4" />
Add to cart
</Button>
</CardFooter>
</Card>
)
}Iteration speed
Traditionally, creating such a component would take 30-60 minutes. With v0, it is a matter of a single prompt and possible iterations. The entire process from idea to working code takes minutes.
Learning by example
v0 is also a great educational tool. By analyzing the generated code, you learn:
- Tailwind CSS best practices
- Component composition patterns
- How to use the shadcn/ui library
- Responsive layout structures
How to get started with v0?
Step 1: Registration
- Go to v0.dev
- Log in with your Vercel, GitHub, or email account
- You automatically receive free credits to start
Step 2: Your first prompt
Type a component description in the text field. The more detailed the prompt, the better the result:
❌ Simple prompt (weak result):
"Create a form"
✅ Detailed prompt (great result):
"Create a contact form with fields: name, email, subject (dropdown:
Inquiry, Support, Collaboration), message (textarea). Add inline
validation, a submit button with loading state, and dark mode support.
Use shadcn/ui components with subtle animations."Step 3: Iteration
After the code is generated, you can:
- Modify the prompt - "Add a phone number field"
- Use Visual Controls - Precisely adjust colors, spacing
- Ask for variants - "Create a version with a multi-step form"
Step 4: Export to your project
# Option 1: Copy code directly
# Click "Copy Code" and paste into your project
# Option 2: Use npx to install the component
npx v0@latest add <component-url>
# Option 3: Integration with a Next.js project
# In a Next.js project you can import directly from v0Advanced prompting techniques
Structure of an ideal prompt
## v0 prompt template
[COMPONENT TYPE]: What you're creating (card, form, dashboard)
[CONTENT]: What elements it contains
[FUNCTIONALITY]: What interactions it has
[STYLE]: Aesthetics, theme, color scheme
[TECHNOLOGY]: shadcn/ui, Tailwind, React hooks
[EXTRAS]: Dark mode, animations, responsivenessExamples of effective prompts
SaaS landing page
Create a modern SaaS landing page with:
HERO SECTION:
- Gradient background (purple to blue)
- Large headline with typing animation effect
- Subheadline explaining the product value
- Two CTAs: "Start Free Trial" (primary) and "Watch Demo" (secondary/outline)
- Floating dashboard mockup image with shadow
FEATURES SECTION:
- 3 columns grid with icons
- Each feature: icon, title, description
- Subtle hover animation on cards
PRICING:
- 3 tier cards: Free, Pro, Enterprise
- Monthly/Annual toggle
- Highlighted "Most Popular" badge on Pro
- Feature comparison list
TESTIMONIALS:
- Carousel with customer quotes
- Avatar, name, company, quote
FOOTER:
- 4 column links layout
- Newsletter subscription
- Social media icons
Use shadcn/ui components, Tailwind CSS, smooth scroll,
and ensure full dark mode support.Analytics dashboard
Build an analytics dashboard with:
SIDEBAR:
- Logo at top
- Navigation: Dashboard, Analytics, Users, Settings, Reports
- Icons from lucide-react
- Collapsible on mobile
- Active state indicator
- User avatar and dropdown at bottom
MAIN CONTENT:
- Header with search, notifications bell, user menu
- Stats row: 4 metric cards (users, revenue, orders, conversion)
- Each with icon, value, percentage change, sparkline chart
- Charts section:
- Revenue over time (area chart)
- Traffic sources (pie chart)
- Recent activity table:
- Columns: User, Action, Date, Status
- Pagination
- Sort functionality
- Status badges (Completed, Pending, Failed)
Use Recharts for charts, shadcn/ui for components,
framer-motion for subtle animations.E-commerce product page
Design a product page for an e-commerce fashion store:
GALLERY:
- Main image with zoom on hover
- Thumbnail strip below (5 images)
- Click thumbnail to change main image
- Lightbox view on click
PRODUCT INFO:
- Breadcrumbs navigation
- Product title (large)
- Star rating with review count
- Price with strikethrough original price
- Color swatches (clickable)
- Size selector (S, M, L, XL) with size guide link
- Quantity selector
- Add to cart button (full width)
- Wishlist heart icon
TABS BELOW:
- Description
- Specifications (table format)
- Reviews (list with pagination)
RELATED PRODUCTS:
- Horizontal scrollable row
- 4 product cards visible
Mobile-first, fast loading, accessible.Integration with Next.js
Installing components from v0
# First, configure shadcn/ui in your project
npx shadcn@latest init
# Install required dependencies
npm install @radix-ui/react-icons lucide-react
# Add components generated by v0
npx v0@latest add https://v0.dev/chat/b/xxxxxProject structure with v0
src/
├── app/
│ ├── page.tsx # Uses components from v0
│ └── dashboard/
│ └── page.tsx
├── components/
│ ├── ui/ # shadcn/ui base components
│ │ ├── button.tsx
│ │ ├── card.tsx
│ │ └── ...
│ └── v0/ # Components generated by v0
│ ├── hero-section.tsx
│ ├── pricing-cards.tsx
│ └── feature-grid.tsx
├── lib/
│ └── utils.ts # cn() helper from shadcn
└── styles/
└── globals.css # Tailwind + shadcn stylesCustomizing generated code
v0 generates code that is easy to extend:
// Original component from v0
export function FeatureCard({ title, description, icon }: FeatureCardProps) {
return (
<Card>
<CardHeader>
{icon}
<CardTitle>{title}</CardTitle>
</CardHeader>
<CardContent>
<p>{description}</p>
</CardContent>
</Card>
)
}
// Your extension with additional features
export function FeatureCard({
title,
description,
icon,
href, // Added
onClick, // Added
isLoading // Added
}: ExtendedFeatureCardProps) {
const content = (
<Card className={cn(
"transition-all duration-200",
href && "cursor-pointer hover:shadow-lg hover:-translate-y-1",
isLoading && "opacity-50 pointer-events-none"
)}>
<CardHeader>
{isLoading ? <Skeleton className="h-8 w-8" /> : icon}
<CardTitle>{title}</CardTitle>
</CardHeader>
<CardContent>
<p>{description}</p>
</CardContent>
</Card>
)
if (href) {
return <Link href={href}>{content}</Link>
}
if (onClick) {
return <button onClick={onClick}>{content}</button>
}
return content
}Visual Controls - Precise editing
Available controls
After generating a component, v0 offers Visual Controls:
Colors - Change the color palette
- Primary, Secondary, Accent
- Background, Foreground
- Border, Muted colors
Typography - Fonts and sizes
- Font family
- Heading sizes (h1-h6)
- Body text size
- Line height, letter spacing
Spacing - Gaps and distances
- Padding (inner)
- Margin (outer)
- Gap (between elements)
Layout - Arrangement
- Flex direction
- Grid columns
- Alignment
- Justify content
Effects - Visual effects
- Border radius
- Shadow
- Opacity
- Blur
Workflow with Visual Controls
1. Generate a component with a prompt
2. Use Visual Controls to fine-tune
3. Check the preview at different breakpoints
4. Click "View Code" to see the changes
5. Export the final codeMulti-framework support
v0 supports multiple frameworks:
React (default)
// Default output - React + Tailwind + shadcn/ui
export function Button({ children, variant = "default" }) {
return (
<button className={cn(
"px-4 py-2 rounded-md font-medium",
variant === "default" && "bg-primary text-primary-foreground",
variant === "outline" && "border border-input"
)}>
{children}
</button>
)
}Vue
<!-- Vue output -->
<template>
<button :class="buttonClasses">
<slot />
</button>
</template>
<script setup>
import { computed } from 'vue'
const props = defineProps({
variant: {
type: String,
default: 'default'
}
})
const buttonClasses = computed(() => [
'px-4 py-2 rounded-md font-medium',
props.variant === 'default' && 'bg-primary text-primary-foreground',
props.variant === 'outline' && 'border border-input'
])
</script>Svelte
<!-- Svelte output -->
<script>
export let variant = 'default'
$: buttonClasses = [
'px-4 py-2 rounded-md font-medium',
variant === 'default' && 'bg-primary text-primary-foreground',
variant === 'outline' && 'border border-input'
].filter(Boolean).join(' ')
</script>
<button class={buttonClasses}>
<slot />
</button>HTML/CSS (vanilla)
<!-- Vanilla HTML output -->
<button class="btn btn-default">
Click me
</button>
<style>
.btn {
padding: 0.5rem 1rem;
border-radius: 0.375rem;
font-weight: 500;
}
.btn-default {
background-color: var(--primary);
color: var(--primary-foreground);
}
.btn-outline {
border: 1px solid var(--border);
}
</style>AutoFix - Automatic error repair
v0 automatically detects and fixes common issues:
AutoFix examples
// Problem: Missing import
// v0 automatically adds:
import { useState } from 'react'
// Problem: Undefined type
// v0 generates the interface:
interface CardProps {
title: string
description: string
}
// Problem: Accessibility
// v0 adds the appropriate attributes:
<button aria-label="Close dialog">
<X className="h-4 w-4" />
</button>
// Problem: Responsiveness
// v0 adds breakpoints:
<div className="grid grid-cols-1 md:grid-cols-2 lg:grid-cols-3">v0 pricing (2025)
Credit system
v0 uses a token-based credit system:
| Plan | Price | Credits | Ideal for |
|---|---|---|---|
| Free | $0 | $5/month | Testing, learning |
| Premium | $20/mo. | $20/month | Individual developers |
| Team | $30/user/mo. | Shared pool | Teams, agencies |
How much does generation cost?
- Simple component (Button, Card): ~$0.10-0.20
- Medium component (Form, Modal): ~$0.30-0.50
- Complex component (Dashboard section): ~$0.50-1.00
- Full page: ~$1.00-3.00
Cost optimization
- Write detailed prompts - Fewer iterations = fewer credits
- Use templates - v0 offers ready-made templates as a starting point
- Iterate selectively - Modify only the sections you need
- Export and edit locally - Make small changes in your IDE
v0 vs alternatives
v0 vs GitHub Copilot
| Aspect | v0 | GitHub Copilot |
|---|---|---|
| Approach | Prompt → ready component | Inline suggestions |
| Context | Single prompt | Entire file/project |
| Output | Complete components | Code snippets |
| Visual editing | Yes | No |
| Best for | UI generation | General coding |
v0 vs Cursor Composer
| Aspect | v0 | Cursor Composer |
|---|---|---|
| Specialization | UI/Frontend | Any code |
| Environment | Web browser | IDE (VS Code fork) |
| Integration | shadcn/ui native | Any libraries |
| Multi-file | No | Yes |
| Best for | React components | Full projects |
v0 vs Figma + Dev Mode
| Aspect | v0 | Figma Dev Mode |
|---|---|---|
| Workflow | Prompt → Code | Design → Code |
| Requires design | No | Yes |
| CSS quality | Tailwind (production) | Inline styles (basic) |
| Interactivity | Full (React) | Static HTML |
| Best for | Rapid prototyping | Design handoff |
Practical use case scenarios
Scenario 1: Startup MVP
You have 2 weeks for an MVP. How to use v0?
Day 1-2: Landing page
- v0: "SaaS landing page with waitlist signup"
- Adjust branding in Visual Controls
- Export to Next.js
Day 3-5: Dashboard
- v0: "Admin dashboard with user management"
- Add your own business logic
- Connect to API
Day 6-7: Onboarding
- v0: "Multi-step onboarding wizard"
- Integrate with auth (Clerk/NextAuth)
Result: Professional UI in a week instead of a monthScenario 2: Design system
You're building a design system for your company:
1. Generate base components in v0:
- Button (all variants)
- Input, Select, Checkbox
- Card, Modal, Toast
- Table, Pagination
2. Customize to brand guidelines:
- Company colors
- Typography
- Spacing system
3. Export as a library:
- Create an npm package
- Storybook documentation
- Unit tests
Result: Consistent design system in days instead of weeksScenario 3: Freelancer
A client needs a quick mockup:
1. Prompt based on the brief
2. 15 minutes of iterations
3. Live preview for the client
4. Feedback → more iterations
5. Export after approval
Result: Mockup in an hour, implementation in a dayTips & best practices
Do's
✅ Write detailed prompts with context
✅ Use shadcn/ui component names in your prompts
✅ Iterate in small steps
✅ Check accessibility of generated code
✅ Adapt the code to your conventions after export
✅ Learn from the generated codeDon'ts
❌ Don't copy code without reviewing it
❌ Don't ignore TypeScript warnings
❌ Don't use v0 for business logic
❌ Don't expect perfection on the first try
❌ Don't use overly generic promptsPrompt engineering tips
## Structure of an effective prompt
1. CONTEXT - What the project is about
"For a healthcare SaaS dashboard..."
2. COMPONENTS - What to use
"Using shadcn/ui Card, Button, and Table..."
3. FUNCTIONALITY - What it does
"That displays patient list with search, sort, and pagination..."
4. STYLE - How it looks
"Clean, minimal design with blue accent color..."
5. BEHAVIORS - Interactions
"With hover states, loading skeletons, and empty states..."
6. TECHNICAL - Requirements
"Fully accessible, dark mode support, mobile responsive..."Integration with your workflow
v0 + Cursor
# 1. Generate a component in v0
# 2. Export the code
# 3. Paste into Cursor
# 4. Use Cursor AI to extend:
"Add unit tests for this component"
"Create a Storybook story"
"Add form validation with Zod"v0 + Storybook
// After exporting from v0, add a story:
import type { Meta, StoryObj } from '@storybook/react'
import { ProductCard } from './ProductCard'
const meta: Meta<typeof ProductCard> = {
title: 'Components/ProductCard',
component: ProductCard,
tags: ['autodocs'],
}
export default meta
type Story = StoryObj<typeof ProductCard>
export const Default: Story = {
args: {
name: 'Product Name',
price: 99.99,
rating: 4.5,
image: '/placeholder.jpg',
category: 'Electronics',
inStock: true,
},
}
export const OutOfStock: Story = {
args: {
...Default.args,
inStock: false,
},
}v0 + GitHub Actions
# .github/workflows/v0-components.yml
name: Track v0 Components
on:
push:
paths:
- 'src/components/v0/**'
jobs:
document:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Generate component docs
run: |
# Track which v0 components are used
find src/components/v0 -name "*.tsx" | wc -lFAQ - Frequently asked questions
Will v0 replace front-end developers?
No. v0 is a tool that accelerates work, not one that replaces it. A developer still needs to:
- Write business logic
- Integrate with APIs
- Optimize performance
- Ensure accessibility
- Test and debug
v0 automates the most repetitive tasks (writing JSX, Tailwind classes), letting you focus on what truly matters.
How does v0 handle custom design systems?
v0 uses shadcn/ui by default, but you can:
- Customize the theme through Visual Controls
- Modify the generated code
- Describe your design system in the prompt
"Use my company design system colors:
- Primary: #1a365d (navy blue)
- Secondary: #ed8936 (orange)
- Background: #f7fafc (light gray)
And 8px spacing grid"Is the code from v0 production-ready?
For the most part, yes. v0 generates:
- Valid TypeScript
- Accessible HTML
- Responsive styles
However, always review the code for:
- Performance (lazy loading, memoization)
- Security (user input handling)
- Edge cases (loading, error states)
How to deal with credit limits?
- Write precise prompts - Fewer iterations
- Use templates - They save credits
- Export early - Make small edits locally
- Team plan - Shared credits for the whole team
Can I use v0 for commercial projects?
Yes. The generated code is yours and you can use it in commercial projects without any restrictions.
Summary
v0 is a game-changer for front-end development. It combines the power of AI with the quality of shadcn/ui and the Vercel ecosystem, creating a tool that:
- Speeds up development - Components in minutes instead of hours
- Raises quality - Production code with best practices
- Teaches good patterns - Analyze the generated code
- Integrates with your workflow - Next.js, Cursor, Storybook
Is it for you? If you build React/Next.js interfaces, v0 is a must-have in your toolbox. The free tier lets you test the capabilities, and for professionals $20/month is an investment that pays for itself within the first day of work.