apps/v4/content/docs/(root)/new.mdx
Here are a few things you can do to get started building with shadcn/ui.
Use the CLI to add components to your project.
npx shadcn@latest add button
Then import and use it in your code.
import { Button } from "@/components/ui/button"
export default function Home() {
return <Button>Click me</Button>
}
Unlike traditional component libraries, shadcn/ui adds the component source code directly to your project under components/ui/. You own the code and can customize it however you want.
You can add multiple components at once or add all available components.
npx shadcn@latest add button card input label
npx shadcn@latest add --all
Browse all components on the Components page.
You can edit your theme directly in your CSS file. Learn more about Theming and how to use CSS variables or utility classes.
If you want to try a new preset, you can create a custom theme visually on ui.shadcn.com and apply it to your project using a preset code.
npx shadcn@latest init --preset [CODE]
You can add a block to your project using the CLI.
npx shadcn@latest add login-03
This will add the login-03 block to your project. Import and use it in your code.
import { Login03 } from "@/components/login-03"
export default function Home() {
return <Login03 />
}
shadcn/ui has a growing ecosystem of community registries. You can install components from any registry URL using the CLI.
npx shadcn@latest add @[registry]/[name]
Browse the Registry Directory for a list of available registries.
shadcn/ui is designed to work with AI. Your AI assistant can read the component source code in your project, understand the APIs, and compose them together to build pages and features.
Here are some example prompts to try:
Install the shadcn skill in your AI assistant. This will give your AI assistant access to the full component registry, documentation, and search.
npx skills add shadcn/ui
Learn more about skills.
The shadcn MCP server gives your AI assistant access to the full component registry, documentation, and search. Connect it in your editor for the best experience.
npx shadcn@latest mcp init
Learn more on the MCP Server page.