Shadcn.io is not affiliated with official shadcn/ui
Why AI tools work
Agents read the file in your repo, not a package in node_modules. Add from the shadcn.io registry with the official CLI — Cursor, Claude, Copilot.
A packaged library hides the styles. The model sees an import and guesses. A shadcn component is a file in components/ui — open it, edit a class, that is the product.
The assistant sees import { Button } from "some-ui". Props maybe. Hover, variants, and focus rings live in a theme bag it cannot open.
import { Button } from "some-ui"
<Button color="primary">Save</Button>Add it, then ask
Write the file
npx shadcn@latest add https://www.shadcn.io/r/button.jsonPoint the agent at the path
“Open components/ui/button.tsx and add a ghost variant.” It reads buttonVariants, not a page about theme.palette.primary.
Keep the diff
The edit is yours. There is no upstream package to fight on the next upgrade.
What the model reads
Variants are strings. hover:bg-primary/80 is the hover. No sx object to invent.
export const buttonVariants = cva(
"inline-flex items-center justify-center rounded-lg text-sm font-medium",
{
variants: {
variant: {
default: "bg-primary text-primary-foreground [a]:hover:bg-primary/80",
outline: "border-border bg-background hover:bg-muted",
ghost: "hover:bg-muted hover:text-foreground",
destructive: "bg-destructive/10 text-destructive hover:bg-destructive/20",
},
},
},
)Ask for quieter and it copies ghost. Ask for red and it copies destructive.
Add the file before you ask
If components/ui/button.tsx is missing, the agent will import a package that is not in the repo. Registry first, then the prompt.
MCP
The shadcn.io MCP server lets Cursor or Claude Desktop search the catalog and install with the same URL.
npx shadcn@latest add https://www.shadcn.io/r/accordion.jsonOfficial npx shadcn@latest. Our https://www.shadcn.io/r/{name}.json. Nothing else.
Try it on these
Variants the model can copy
Dialog"use client" already set
Fields the agent can extend
Data TableColumns it can add
CommandItems it can append
AccordionPanels it can rename
Questions
Related
Was this page helpful?
Sign in to leave feedback.
All components
Browse every shadcn/ui primitive — buttons, forms, overlays, and more. Copy-paste React components for Next.js with Tailwind CSS.
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.