description: shadcn/ui conventions globs: ["/*.tsx", "components.json", "/components/ui/**"] alwaysApply: false
- shadcn/ui is open code copied into your repo — you own the components in
components/ui. Edit them directly; don't wrap or npm-install them. - Add components with the CLI:
npx shadcn@latest add <component>(init once withnpx shadcn@latest init). - Compose conditional classes with
cn()(@/lib/utils, clsx + tailwind-merge), never string concatenation. - Variants via
cva(class-variance-authority), exposed through props — don't fork a component per variant. - Built on Radix primitives + Tailwind; keep
"use client"on interactive components. Icons fromlucide-react. - Theme via CSS variables and semantic tokens (
bg-background,text-foreground,border-input); don't hardcode raw colors. - Respect
components.json(style/rsc/baseColor/ aliases@/components,@/lib/utils); keep new components consistent with it.