logo
🤖 AI 工具

v0.dev

v0.dev Cheat Sheet - 快速参考指南,收录常用语法、命令与实践。

📂 分类 · AI 工具🧭 Markdown 速查🏷️ 4 个标签
#ai#ui#react#vercel
向下滚动查看内容
返回全部 Cheat Sheets

Overview

What is v0
  • AI-powered UI component generator by Vercel
  • Generates React code with Tailwind CSS
  • Uses shadcn/ui component library
  • Outputs production-ready code
  • Supports iterative refinement
Key Features
FeatureDescription
Text to UIGenerate UI from descriptions
Component Libraryshadcn/ui based components
ResponsiveMobile-first designs
Dark ModeBuilt-in theme support
ExportCopy code directly to project
Tech Stack Generated
  • React / Next.js
  • TypeScript
  • Tailwind CSS
  • shadcn/ui components
  • Lucide icons
  • Radix UI primitives

Prompt Basics

Basic Structure
CODE
滚动查看更多
Create a [component type] that [functionality]
with [styling/features]
Component Types
  • Landing page
  • Dashboard
  • Form
  • Card
  • Modal/Dialog
  • Navigation
  • Table
  • Chart
  • Profile page
  • Settings panel
Styling Keywords
  • Modern / Minimal / Clean
  • Dark mode / Light mode
  • Rounded corners
  • Subtle shadows
  • Gradient backgrounds
  • Glass effect / Glassmorphism
  • Neumorphism
Layout Keywords
  • Responsive
  • Mobile-first
  • Grid layout
  • Flexbox
  • Sidebar layout
  • Full-width
  • Centered
  • Split screen

Prompt Examples

Landing Pages

Hero Section

CODE
滚动查看更多
Create a modern hero section for a SaaS product
with a headline, subheading, CTA button, and
a product screenshot mockup. Include gradient
background and floating elements.

Pricing Page

CODE
滚动查看更多
Create a pricing page with 3 tiers:
- Free, Pro ($29/mo), Enterprise (custom)
- Include feature comparison
- Highlight recommended plan
- Add toggle for monthly/yearly billing
- Modern card design with hover effects

Features Section

CODE
滚动查看更多
Create a features section with 6 feature cards
in a 3x2 grid. Each card has an icon, title,
and description. Include subtle animations
on hover.
Dashboards

Analytics Dashboard

CODE
滚动查看更多
Create an analytics dashboard with:
- Stats cards (users, revenue, orders, growth)
- Line chart for trends
- Recent activity list
- Sidebar navigation
- Dark mode design

Admin Panel

CODE
滚动查看更多
Create an admin dashboard layout with:
- Collapsible sidebar
- Top navbar with search and user menu
- Main content area with stats
- Recent orders table
- Quick actions panel
Forms

Login Form

CODE
滚动查看更多
Create a login form with:
- Email and password fields
- Remember me checkbox
- Forgot password link
- Social login buttons (Google, GitHub)
- Clean, centered card design

Multi-Step Form

CODE
滚动查看更多
Create a multi-step form wizard with:
- Progress indicator showing 4 steps
- Personal info, Address, Payment, Review
- Back and Next buttons
- Form validation indicators
- Smooth transitions between steps

Contact Form

CODE
滚动查看更多
Create a contact form with:
- Name, email, subject fields
- Message textarea
- File attachment option
- Submit button with loading state
- Success/error messages
Cards & Components

Product Card

CODE
滚动查看更多
Create an e-commerce product card with:
- Product image with hover zoom
- Title, price, rating stars
- Add to cart button
- Wishlist icon
- Sale badge option

User Profile Card

CODE
滚动查看更多
Create a user profile card with:
- Avatar image
- Name and role/title
- Bio text
- Social media links
- Follow/Message buttons
- Stats (followers, following, posts)

Testimonial Card

CODE
滚动查看更多
Create a testimonial card with:
- Customer photo
- Quote text
- Name and company
- Star rating
- Subtle background pattern
Navigation

Navbar

CODE
滚动查看更多
Create a responsive navbar with:
- Logo on the left
- Navigation links in center
- Search bar
- User dropdown on right
- Mobile hamburger menu
- Sticky on scroll

Sidebar

CODE
滚动查看更多
Create a dashboard sidebar with:
- Logo at top
- Navigation sections with icons
- Collapsible sub-menus
- Active state indicator
- Collapse button
- User info at bottom
Tables

Data Table

CODE
滚动查看更多
Create a data table with:
- Search and filter options
- Sortable columns
- Pagination
- Row selection checkboxes
- Actions dropdown per row
- Responsive design

Advanced Prompts

E-commerce
CODE
滚动查看更多
Create a complete e-commerce product page with:
- Image gallery with thumbnails
- Product title, price, ratings
- Size and color selectors
- Quantity picker
- Add to cart and buy now buttons
- Product tabs (description, reviews, shipping)
- Related products section
SaaS Application
CODE
滚动查看更多
Create a SaaS project management interface with:
- Kanban board with 3 columns
- Draggable task cards
- Add new task button
- Task card with title, assignee avatar,
  due date, and priority tag
- Column actions menu
Blog/Content
CODE
滚动查看更多
Create a blog post page with:
- Hero image
- Title, author info, date
- Reading time estimate
- Article content with typography
- Table of contents sidebar
- Share buttons
- Related posts at bottom
- Comments section
Settings Page
CODE
滚动查看更多
Create a settings page with:
- Vertical tabs navigation
- Profile settings section
- Notification preferences with toggles
- Security settings (password, 2FA)
- Connected accounts
- Danger zone (delete account)
- Save changes button

Refinement Prompts

Styling Changes
CODE
滚动查看更多
Make it more modern with:
- Rounded corners (larger radius)
- Subtle shadows
- More whitespace
- Smoother transitions
CODE
滚动查看更多
Add dark mode variant
CODE
滚动查看更多
Change color scheme to use
blue and purple gradients
Layout Changes
CODE
滚动查看更多
Make it responsive for mobile:
- Stack elements vertically
- Larger touch targets
- Collapsible sections
CODE
滚动查看更多
Add more whitespace between sections
CODE
滚动查看更多
Change to a 2-column layout on desktop
Feature Additions
CODE
滚动查看更多
Add a loading skeleton state
CODE
滚动查看更多
Add hover animations to the cards
CODE
滚动查看更多
Include form validation with
error messages
CODE
滚动查看更多
Add success and error toast notifications
Content Changes
CODE
滚动查看更多
Replace placeholder text with
realistic content for a fitness app
CODE
滚动查看更多
Add more items to the navigation
CODE
滚动查看更多
Include empty state for when
there's no data

Best Practices

Writing Effective Prompts
  1. Be specific - Include exact requirements
  2. Mention components - Cards, buttons, forms
  3. Specify layout - Grid, flex, sidebar
  4. Include states - Hover, active, loading
  5. Consider responsive - Mobile, tablet, desktop
Iterative Refinement
CODE
滚动查看更多
Step 1: Generate basic structure
"Create a dashboard layout"

Step 2: Add components
"Add stats cards at the top"

Step 3: Refine styling
"Use a blue color scheme"

Step 4: Add features
"Include loading states"
Export Best Practices
  1. Review generated code
  2. Check dependencies needed
  3. Install required packages
  4. Copy components to project
  5. Customize as needed

Code Export

Using Generated Code
  1. Install dependencies
BASH
滚动查看更多
npx shadcn@latest init
npx shadcn@latest add button card input
npm install lucide-react
  1. Copy component code
TSX
滚动查看更多
// Copy from v0 to your components folder
// components/ui/your-component.tsx
  1. Import and use
TSX
滚动查看更多
import { YourComponent } from '@/components/ui/your-component';

export default function Page() {
	return <YourComponent />;
}
Required Setup

Next.js project

BASH
滚动查看更多
npx create-next-app@latest my-app
cd my-app
npx shadcn@latest init
Common Dependencies
JSON
滚动查看更多
{
	"dependencies": {
		"@radix-ui/react-*": "latest",
		"class-variance-authority": "^0.7.0",
		"clsx": "^2.0.0",
		"lucide-react": "^0.263.1",
		"tailwind-merge": "^1.14.0"
	}
}

Tips & Tricks

Get Better Results
  • Reference popular designs (Stripe, Linear)
  • Specify exact spacing (more/less whitespace)
  • Mention animation preferences
  • Include accessibility requirements
  • Ask for multiple variations
Common Patterns
CODE
滚动查看更多
"Like [popular product]'s [component]"
Example: "Like Notion's sidebar navigation"
CODE
滚动查看更多
"Modern and minimal like Linear"
CODE
滚动查看更多
"With glassmorphism like Apple"
Accessibility
CODE
滚动查看更多
Add in your prompts:
- ARIA labels
- Keyboard navigation
- Focus indicators
- Screen reader support
- Color contrast compliance

Limitations

What v0 Can't Do
  • Backend logic
  • Database connections
  • Authentication systems
  • Real data fetching
  • Complex state management
  • Third-party API integrations
What You'll Need to Add
  • API routes and data fetching
  • Form submission handlers
  • Authentication logic
  • Real database queries
  • Error boundary handling
  • Unit tests

Keyboard Shortcuts

ShortcutAction
EnterSubmit prompt
Shift + EnterNew line in prompt
Cmd/Ctrl + CCopy code
TabSwitch between versions

相关 Cheat Sheets

1v1免费职业咨询
logo

Follow Us

linkedinfacebooktwitterinstagramweiboyoutubebilibilitiktokxigua

We Accept

/image/layout/pay-paypal.png/image/layout/pay-visa.png/image/layout/pay-master-card.png/image/layout/pay-airwallex.png/image/layout/pay-alipay.png

地址

Level 10b, 144 Edward Street, Brisbane CBD(Headquarter)
Level 2, 171 La Trobe St, Melbourne VIC 3000
四川省成都市武侯区桂溪街道天府大道中段500号D5东方希望天祥广场B座45A13号
Business Hub, 155 Waymouth St, Adelaide SA 5000

Disclaimer

footer-disclaimerfooter-disclaimer

JR Academy acknowledges Traditional Owners of Country throughout Australia and recognises the continuing connection to lands, waters and communities. We pay our respect to Aboriginal and Torres Strait Islander cultures; and to Elders past and present. Aboriginal and Torres Strait Islander peoples should be aware that this website may contain images or names of people who have since passed away.

匠人学院网站上的所有内容,包括课程材料、徽标和匠人学院网站上提供的信息,均受澳大利亚政府知识产权法的保护。严禁未经授权使用、销售、分发、复制或修改。违规行为可能会导致法律诉讼。通过访问我们的网站,您同意尊重我们的知识产权。 JR Academy Pty Ltd 保留所有权利,包括专利、商标和版权。任何侵权行为都将受到法律追究。查看用户协议

© 2017-2025 JR Academy Pty Ltd. All rights reserved.

ABN 26621887572