v0.dev: Generate Production-Ready React Components from Text Prompts
Vercel released v0.dev. Type what you want, get React components. “Create a pricing page with 3 tiers.” Boom - complete component with Tailwind CSS.
I built 5 landing pages in 2 hours. Here’s what works and what doesn’t.
Table of Contents
What is v0.dev?
Text → React Component generator.
Input: “Create a hero section with gradient background” Output: Complete React + Tailwind component, ready to use
Powered by GPT-4 + custom UI training.
Getting Started
# Visit v0.dev
# Sign in with GitHub
# Start prompting
Free tier: 200 credits/month Pro: $20/month unlimited
Example 1: Hero Section
Prompt:
Create a modern hero section with:
- Gradient background (purple to blue)
- Large heading and subheading
- Two CTA buttons (primary and secondary)
- Responsive design
Generated Code:
export default function Hero() {
return (
<div className="relative overflow-hidden bg-gradient-to-br from-purple-600 to-blue-600">
<div className="mx-auto max-w-7xl px-6 py-24 sm:py-32 lg:px-8">
<div className="mx-auto max-w-2xl text-center">
<h1 className="text-4xl font-bold tracking-tight text-white sm:text-6xl">
Build faster with AI-powered tools
</h1>
<p className="mt-6 text-lg leading-8 text-gray-100">
Transform your ideas into production-ready applications in minutes,
not hours. Our AI-powered platform handles the complexity.
</p>
<div className="mt-10 flex items-center justify-center gap-x-6">
<a
href="#"
className="rounded-md bg-white px-3.5 py-2.5 text-sm font-semibold text-purple-600 shadow-sm hover:bg-gray-100 focus-visible:outline focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-white"
>
Get started
</a>
<a
href="#"
className="text-sm font-semibold leading-6 text-white"
>
Learn more <span aria-hidden="true">→</span>
</a>
</div>
</div>
</div>
</div>
);
}
Result: Perfect! Copy-paste ready.
Example 2: Pricing Table
Prompt:
Create a pricing table with 3 tiers:
- Free: $0, 10 projects, basic support
- Pro: $29, unlimited projects, priority support, advanced features
- Enterprise: Custom pricing, dedicated support, SLA
Include:
- Popular badge on Pro tier
- Feature comparison
- CTA buttons
- Dark mode support
Generated Code (simplified):
export default function Pricing() {
const tiers = [
{
name: 'Free',
price: '$0',
features: ['10 projects', 'Basic support', 'Community access'],
cta: 'Start free',
popular: false,
},
{
name: 'Pro',
price: '$29',
features: ['Unlimited projects', 'Priority support', 'Advanced features', 'API access'],
cta: 'Start trial',
popular: true,
},
{
name: 'Enterprise',
price: 'Custom',
features: ['Dedicated support', 'SLA guarantee', 'Custom integrations', 'Training'],
cta: 'Contact sales',
popular: false,
},
];
return (
<div className="bg-white dark:bg-gray-900 py-24 sm:py-32">
<div className="mx-auto max-w-7xl px-6 lg:px-8">
<div className="mx-auto max-w-4xl text-center">
<h2 className="text-3xl font-bold tracking-tight text-gray-900 dark:text-white sm:text-4xl">
Pricing plans for teams of all sizes
</h2>
</div>
<div className="mt-16 grid grid-cols-1 gap-8 sm:grid-cols-2 lg:grid-cols-3">
{tiers.map((tier) => (
<div
key={tier.name}
className={`relative rounded-2xl border ${
tier.popular
? 'border-purple-600 shadow-lg'
: 'border-gray-200 dark:border-gray-700'
} p-8`}
>
{tier.popular && (
<div className="absolute -top-4 left-1/2 -translate-x-1/2">
<span className="rounded-full bg-purple-600 px-4 py-1 text-sm font-semibold text-white">
Popular
</span>
</div>
)}
<h3 className="text-lg font-semibold text-gray-900 dark:text-white">
{tier.name}
</h3>
<p className="mt-4 flex items-baseline gap-x-2">
<span className="text-4xl font-bold tracking-tight text-gray-900 dark:text-white">
{tier.price}
</span>
{tier.price !== 'Custom' && (
<span className="text-sm font-semibold text-gray-600 dark:text-gray-400">
/month
</span>
)}
</p>
<ul className="mt-8 space-y-3">
{tier.features.map((feature) => (
<li key={feature} className="flex gap-x-3">
<svg className="h-6 w-5 flex-none text-purple-600" viewBox="0 0 20 20" fill="currentColor">
<path fillRule="evenodd" d="M16.704 4.153a.75.75 0 01.143 1.052l-8 10.5a.75.75 0 01-1.127.075l-4.5-4.5a.75.75 0 011.06-1.06l3.894 3.893 7.48-9.817a.75.75 0 011.05-.143z" clipRule="evenodd" />
</svg>
<span className="text-sm text-gray-600 dark:text-gray-400">
{feature}
</span>
</li>
))}
</ul>
<button
className={`mt-8 w-full rounded-md px-3.5 py-2.5 text-sm font-semibold ${
tier.popular
? 'bg-purple-600 text-white hover:bg-purple-500'
: 'bg-gray-100 text-gray-900 hover:bg-gray-200 dark:bg-gray-800 dark:text-white dark:hover:bg-gray-700'
}`}
>
{tier.cta}
</button>
</div>
))}
</div>
</div>
</div>
);
}
Result: Production-ready! Dark mode included.
Example 3: Dashboard Layout
Prompt:
Create a dashboard layout with:
- Sidebar navigation (collapsible)
- Top header with user menu
- Main content area with stats cards
- Responsive (mobile: bottom nav)
Generated complete dashboard with:
- Sidebar component
- Header component
- Stats cards
- Mobile navigation
- All responsive
Time: 2 minutes vs 2 hours manual coding.
Real Project: Landing Page
Built complete landing page:
Sections needed:
- Hero
- Features (3 columns)
- Pricing
- Testimonials
- FAQ
- Footer
Process:
Prompt 1: "Create hero section..."
→ Copy component
Prompt 2: "Create features section with 3 columns..."
→ Copy component
Prompt 3: "Create pricing table..."
→ Copy component
... repeat for all sections
Assembly:
// app/page.tsx
import Hero from '@/components/Hero';
import Features from '@/components/Features';
import Pricing from '@/components/Pricing';
import Testimonials from '@/components/Testimonials';
import FAQ from '@/components/FAQ';
import Footer from '@/components/Footer';
export default function Home() {
return (
<main>
<Hero />
<Features />
<Pricing />
<Testimonials />
<FAQ />
<Footer />
</main>
);
}
Time: 2 hours (vs 2 days manual)
Customization
Generated code is editable:
Original:
<h1 className="text-4xl font-bold">
Build faster with AI
</h1>
Customized:
<h1 className="text-4xl font-bold">
{title} {/* Make it dynamic */}
</h1>
Easy to modify!
Iteration
Refine with follow-up prompts:
Initial: "Create a contact form"
→ Basic form generated
Follow-up: "Add validation and error messages"
→ Form with validation
Follow-up: "Add success state and loading spinner"
→ Complete form with all states
v0 remembers context!
Comparison with Manual Coding
Task: Create pricing page
| Aspect | Manual | v0.dev | Winner |
|---|---|---|---|
| Time | 4 hours | 10 min | v0 |
| Code quality | 8/10 | 9/10 | v0 |
| Responsiveness | Manual work | Built-in | v0 |
| Dark mode | Extra work | Built-in | v0 |
| Accessibility | Often missed | Included | v0 |
| Customization | Full control | 90% control | Manual |
Limitations
1. Not Perfect for Complex Logic:
// v0 is great for UI
<button onClick={handleClick}>Click me</button>
// But you write the logic
const handleClick = () => {
// Your business logic here
};
2. Requires Tailwind Knowledge:
Generated code uses Tailwind. Need to understand it for customization.
3. Sometimes Over-engineered:
// v0 might generate
<div className="flex items-center justify-center min-h-screen bg-gradient-to-br from-purple-600 via-pink-600 to-blue-600">
// When you just need
<div className="flex items-center justify-center min-h-screen bg-purple-600">
4. Limited Component Libraries:
Generates plain React + Tailwind. If you need shadcn/ui or MUI, requires adaptation.
Best Practices
1. Be Specific:
❌ “Create a form” ✅ “Create a contact form with name, email, message fields, validation, and submit button”
2. Iterate:
Start simple, add features:
1. "Create basic card"
2. "Add hover effect"
3. "Add image and badge"
4. "Make it responsive"
3. Review Generated Code:
Check for:
- Accessibility (aria labels)
- Performance (unnecessary re-renders)
- Security (XSS in user input)
4. Extract Reusable Components:
// v0 generates inline
<button className="rounded-md bg-purple-600...">
Click me
</button>
// Extract to reusable component
<Button variant="primary">Click me</Button>
Integration with Existing Projects
# 1. Generate component in v0.dev
# 2. Copy code
# 3. Paste into your project
# components/Hero.tsx
export default function Hero() {
// v0 generated code
}
# app/page.tsx
import Hero from '@/components/Hero';
export default function Home() {
return <Hero />;
}
Works with:
- Next.js
- Create React App
- Vite
- Any React project
Cost Analysis
Free Tier:
- 200 credits/month
- ~40 components
- Good for side projects
Pro ($20/month):
- Unlimited generations
- Priority support
- Worth it for professionals
ROI:
- Saves 10+ hours/month
- At $100/hour = $1,000 value
- ROI: 5,000%
Real Results
Built 5 landing pages in 2 hours:
Before v0.dev:
- Time per page: 2 days
- Total: 10 days
- Cost: $8,000 (at $100/hour)
With v0.dev:
- Time per page: 24 minutes
- Total: 2 hours
- Cost: $200 + $20 (v0 subscription)
Savings: $7,780 and 78 hours
Lessons Learned
- Great for prototyping - Rapid iteration
- Production-ready code - High quality output
- Saves massive time - 90% faster
- Still need React knowledge - For customization
- Best for UI, not logic - Business logic is yours
Conclusion
v0.dev is a game-changer for frontend development. Not a replacement for developers, but a massive productivity boost.
Best for:
- Landing pages
- Marketing sites
- Dashboards
- UI prototypes
Not ideal for:
- Complex state management
- Custom animations
- Unique designs
Key takeaways:
- 90% faster UI development
- Production-ready code
- Built-in responsiveness and dark mode
- Requires Tailwind knowledge
- Massive ROI ($20/month → $1000/month value)
Try v0.dev. It will change how you build UIs.