Make your AI a shadcn expert

Installation

How to install dependencies and structure your app. Official shadcn CLI, then add a component from the shadcn.io registry — Next.js, Vite, Laravel, and more.

Choose the setup that matches your starting point. init -t scaffolds a new app. init alone configures one you already have. Then add a file from the shadcn.io registry — same CLI, our URL.

Use the CLI

npx shadcn@latest init -t [framework]

Supported templates: next, vite, start, react-router, astro.

Laravel is not a template. Create the app with laravel new, then run npx shadcn@latest init from the project root.

Then add a component. Official registry:

npx shadcn@latest add button

shadcn.io registry — same CLI, our URL:

npx shadcn@latest add https://www.shadcn.io/r/button.json

The file lands in components/ui/button.tsx. Browse the catalog on /ui.

Existing project

Each framework guide has an Existing project section: Tailwind, the @/ alias (or ~/ on React Router), then init with no -t.

Weird bundler? Manual.

Choose your framework

Official add vs our URL

npx shadcn@latest add button hits ui.shadcn.com. npx shadcn@latest add https://www.shadcn.io/r/button.json is this site. Same CLI. Our file is the one on /ui/button.

Questions

Was this page helpful?

Sign in to leave feedback.