Next.js Installation
Install and configure your UI components for Next.js.
Create project
Run the init command to create a new Next.js project or set up an existing one:
pnpm dlx shadcn@latest init
Add Components
You can now start adding components to your project. For example, to add the Button component:
pnpm dlx shadcn@latest add button
The command above will add the Button component to your project. You can then import and use it like this:
1import { Button } from "@/components/ui/button";23export default function Home() {4 return (5 <div>6 <Button>Click me</Button>7 </div>8 );9}
For more details, see the documentation for each component.