Exporting an entire boilerplate repository just to grab a single pricing table or dashboard card is an absurd waste of developer time. If your team already maintains an established React or Next.js codebase, cloning a generated zip file from an AI UI tool creates more merge headaches, dependency mismatches, and configuration debt than writing the UI by hand.
At 365Finds, our stance on generative UI tools is blunt: we do not want full-repo scaffolding for existing projects. We want surgical component injection.
Fortunately, Vercel built direct integration between v0 and the shadcn CLI. Because v0 generates code based on shadcn/ui primitives and Tailwind CSS conventions, you can pull individual components directly into your local repository using a single CLI command. The CLI handles sub-components, registry schemas, and package dependencies automatically.
Here is exactly how the pipeline works, how to run it, and where the subtle integration traps lie.
The Core Mechanism: Remote Registry Resolution
The shadcn CLI is no longer restricted to pulling official primitives from ui.shadcn.com. In current versions of the CLI, shadcn add accepts arbitrary URLs conforming to the shadcn registry schema, as well as direct v0 block and chat endpoints.
When you feed a v0 URL to npx shadcn@latest add, the CLI performs three tasks:
- Fetches the component metadata: It contacts the v0 endpoint and extracts the generated TSX/JSX file structure.
- Resolves transitive dependencies: If the v0 component relies on core shadcn primitives (such as
Button,Dialog,Card, orBadge) that do not yet exist in your@/components/uifolder, the CLI detects them and prompts to install them. - Installs npm packages: It identifies external runtime packages (such as
lucide-react,recharts,date-fns, or@radix-uipackages) and invokes your project's package manager to install them.
You do not touch a zip file. You do not manually copy five separate utility files. The code drops straight into your existing component directory.
Step-by-Step: Importing a v0 Component
1. Verify Local Prerequisites
Your local project must already be configured with Tailwind CSS and initialized with shadcn/ui. Check your project root for a components.json configuration file.
If your codebase has Tailwind CSS installed but hasn't initialized shadcn yet, run:
npx shadcn@latest init
Choose your style, base color, and CSS variables matching your project conventions.
2. Copy the Component Command from v0
- Open v0 and navigate to the prompt session or block you generated.
- Review the preview iteration you want to import.
- In the upper-right corner of the code preview, click Add to Codebase (or click the terminal/code export icon).
- v0 displays a pre-formatted CLI command containing the exact block identifier. It will look like this:
npx shadcn@latest add "https://v0.dev/chat/b/b_ABC123XYZ"
(Note: v0 URLs may use either v0.dev or v0.app domains; the CLI resolves both interchangeably).
3. Execute in Your Project Root
Open your terminal in the root directory of your project (where package.json and components.json reside) and run the command.
If your project standardizes on a specific package runner:
- pnpm:
pnpm dlx shadcn@latest add "https://v0.dev/chat/b/b_ABC123XYZ" - bun:
bunx --bun shadcn@latest add "https://v0.dev/chat/b/b_ABC123XYZ" - npm:
npx shadcn@latest add "https://v0.dev/chat/b/b_ABC123XYZ"
4. Respond to CLI Prompts
The CLI inspects your local components/ directory and prints a plan:
- It lists the incoming v0 component (saved by default into your configured
components/path). - It lists any required shadcn primitives you lack (for example,
card,avatar,input). - It prompts for confirmation before installing missing npm dependencies and creating files.
Once confirmed, the CLI installs the packages, generates the primitive files, and writes the component.
What 365Finds Looks for Before Shipping Imported Code
365Finds strongly prefers this workflow over manual copy-pasting, but automated importation is not an excuse to skip code review. In our evaluations, three recurring friction points require immediate attention:
1. Primitive Collision and Overwrite Prompts
If the v0 design used a modified version of a standard shadcn primitive (e.g., an altered Button variant), the CLI may ask whether you want to overwrite your existing @/components/ui/button.tsx.
Never blindly overwrite existing primitives. Overwriting a shared primitive can break layouts across unrelated parts of your production app. If v0 customized a primitive, decline the overwrite and integrate the specific custom Tailwind classes into the generated parent component instead.
2. The 'use client' Directive Assumption
v0 frequently places 'use client' at the top of generated components whenever interactive hooks, toggles, or event handlers are present. In Next.js App Router projects, inspect whether the entire component truly needs client execution or if you can decompose it into a static Server Component shell wrapping smaller client leaves.
3. Hardcoded Mock Data and Loose Types
AI-generated components almost always embed mock arrays, dummy state, and placeholder image URLs directly inside the UI function. Before wiring the component into your application:
- Extract hardcoded mock arrays into dedicated TypeScript interfaces and typed props.
- Replace placeholder
avatarorimgURLs with your framework's optimized image component (e.g.,next/image). - Verify Lucide icon imports: v0 occasionally selects obscure icon names that may throw compilation errors if you run an older version of
lucide-react.
Run git diff immediately after the CLI command finishes. The diff shows exactly which dependencies were added to package.json and which files were written into components/.