← VercelCONTENT HISTORYWHAT CHANGED · RULE-BASED ANALYSIS
changed
Update to Vercel
Snapshot Sep 30, 2026 · 23:18 UTC · version 0.21.4
Collection source: not recorded for this historical snapshot. These snapshots do not have a confirmed matching collection source. Differences in file lists alone do not establish changes to the package.
Supporting file metadata differs
Newly listed paths: agents/openai.yaml. This compares saved file lists, not package contents; a different collection source can change the list.
Observed in package metadata. These changes alone do not establish a new customer-facing feature.
Supporting files
Before
[]
After
[{"relative_path":"agents/openai.yaml","size_in_bytes":171}]
Compare saved observations
Download comparison JSONFull technical diff · 1 changed fields
changed /included_files
BEFORE
[]
AFTER
[
{
"relative_path": "agents/openai.yaml",
"size_in_bytes": 171
}
]Full snapshot data
{
"name": "shadcn",
"description": "shadcn/ui expert guidance — CLI, component installation, composition patterns, custom registries, theming, Tailwind CSS integration, and high-quality interface design. Use when initializing shadcn, adding components, composing product UI, building custom registries, configuring themes, or troubleshooting component issues.",
"included_files": [
{
"relative_path": "agents/openai.yaml",
"size_in_bytes": 171
}
],
"skill_md_contents": "---\nname: shadcn\ndescription: shadcn/ui expert guidance — CLI, component installation, composition patterns, custom registries, theming, Tailwind CSS integration, and high-quality interface design. Use when initializing shadcn, adding components, composing product UI, building custom registries, configuring themes, or troubleshooting component issues.\nmetadata:\n priority: 6\n docs:\n - \"https://ui.shadcn.com/docs\"\n - \"https://ui.shadcn.com/docs/components\"\n pathPatterns:\n - 'components.json'\n - 'components/ui/**'\n - 'src/components/ui/**'\n - 'apps/*/components/ui/**'\n - 'apps/*/src/components/ui/**'\n - 'packages/*/components/ui/**'\n - 'packages/*/src/components/ui/**'\n bashPatterns:\n - '\\bnpx\\s+shadcn\\b'\n - '\\bnpx\\s+shadcn@latest\\s+(init|add|build|search|list|migrate|info|docs|view)\\b'\n - '\\bnpx\\s+create-next-app\\b'\n - '\\bbunx\\s+create-next-app\\b'\n - '\\bpnpm\\s+create\\s+next-app\\b'\n - '\\bnpm\\s+create\\s+next-app\\b'\n---\n\n# shadcn/ui\n\nYou are an expert in shadcn/ui — a collection of beautifully designed, accessible, and customizable React components built on Radix UI primitives and Tailwind CSS. Components are added directly to your codebase as source code, not installed as a dependency.\n\n## Key Concept\n\nshadcn/ui is **not a component library** in the traditional sense. You don't install it as a package. Instead, the CLI copies component source code into your project, giving you full ownership and customization ability.\n\n## CLI Commands\n\n### Initialize (non-interactive — ALWAYS use this)\n\n**IMPORTANT**: `shadcn init` is interactive by default. Always use `-d` (defaults) for non-interactive initialization:\n\n```bash\n# Non-interactive init with defaults — USE THIS\nnpx shadcn@latest init -d\n\n# Non-interactive with a preset (recommended for consistent design systems)\nnpx shadcn@latest init --preset <code> -f\n\n# Non-interactive with explicit base library choice\nnpx shadcn@latest init -d --base radix\nnpx shadcn@latest init -d --base base-ui\n\n# Scaffold a full project template (CLI v4)\n```\n\n> **AI Elements compatibility**: Always use `--base radix` (the default) when the project uses or may use AI Elements. AI Elements components rely on Radix APIs and have type errors with Base UI.\n\n```bash\nnpx shadcn@latest init --template next -d\nnpx shadcn@latest init --template vite -d\n```\n\nOptions:\n- `-d, --defaults` — **Use default configuration, skip all interactive prompts** (REQUIRED for CI/agent use)\n- `-y, --yes` — Skip confirmation prompts (does NOT skip library selection — use `-d` instead)\n- `-f, --force` — Force overwrite existing configuration\n- `-t, --template` — Scaffold full project template (`next`, `vite`, `react-router`, `astro`, `laravel`, `tanstack-start`)\n- `--preset` — Apply a design system preset (colors, theme, icons, fonts, radius) as a single shareable code\n- `--base` — Choose primitive library: `radix` (default) or `base-ui`\n- `--monorepo` — Set up a monorepo structure\n\n> **WARNING**: `-y`/`--yes` alone does NOT make init fully non-interactive — it still prompts for component library selection. Always use `-d` to skip ALL prompts.\n\n> **Deprecated in CLI v4**: `--style`, `--base-color`, `--src-dir`, `--no-base-style`, and `--css-variables` flags are removed and will error. The `registry:build` and `registry:mcp` registry types are also deprecated. Use `registry:base` and `registry:font` instead.\n\nThe init command:\n1. Detects your framework (Next.js, Vite, React Router, Astro, Laravel, TanStack Start)\n2. Installs required dependencies (Radix UI, tailwind-merge, class-variance-authority)\n3. Creates `components.json` configuration\n4. Sets up the `cn()` utility function\n5. Configures CSS variables for theming\n\n### Add Components\n\n```bash\n# Add specific components\nnpx shadcn@latest add button dialog card\n\n# Add all available components\nnpx shadcn@latest add --all\n\n# Add from a custom registry\nnpx shadcn@latest add @v0/dashboard\nnpx shadcn@latest add @acme/custom-button\n\n# Add from AI Elements registry\nnpx shadcn@latest add https://elements.ai-sdk.dev/api/registry/all.json\n```\n\nOptions:\n- `-o, --overwrite` — Overwrite existing files\n- `-p, --path` — Custom install path\n- `-a, --all` — Install all components\n- `--dry-run` — Preview what will be added without writing files\n- `--diff` — Show diff of changes when updating existing components\n- `--view` — Display a registry item's source code inline\n\n### Search & List\n\n```bash\nnpx shadcn@latest search button\nnpx shadcn@latest list @v0\n```\n\n### Build (Custom Registry)\n\n```bash\nnpx shadcn@latest build\nnpx shadcn@latest build ./registry.json -o ./public/r\n```\n\n### View, Info & Docs (CLI v4)\n\n```bash\n# View a registry item's source before installing\nnpx shadcn@latest view button\n\n# Show project diagnostics — config, installed components, dependencies\nnpx shadcn@latest info\n\n# Get docs, code, and examples for any component (agent-friendly output)\nnpx shadcn@latest docs button\nnpx shadcn@latest docs dialog\n```\n\n> **`shadcn docs`** gives coding agents the context to use primitives correctly — returns code examples, API reference, and usage patterns inline.\n\n### Migrate\n\n```bash\nnpx shadcn@latest migrate rtl # RTL support migration\nnpx shadcn@latest migrate radix # Migrate to unified radix-ui package\nnpx shadcn@latest migrate icons # Icon library changes\n\n# Migrate components outside the default ui directory\nnpx shadcn@latest migrate radix src/components/custom\n```\n\n## shadcn/skills (CLI v4)\n\nshadcn/skills gives coding agents the context they need to work with components and registries correctly. It covers both Radix and Base UI primitives, updated APIs, component patterns, and registry workflows. The skill knows how to use the CLI, when to invoke it, and which flags to pass — so agents produce code that matches your design system.\n\nInstall: `pnpm dlx skills add shadcn/ui`\n\n## Unified Radix UI Package (February 2026)\n\nThe `new-york` style now uses a single `radix-ui` package instead of individual `@radix-ui/react-*` packages:\n\n```tsx\n// OLD — individual packages\nimport * as DialogPrimitive from \"@radix-ui/react-dialog\"\n\n// NEW — unified package\nimport { Dialog as DialogPrimitive } from \"radix-ui\"\n```\n\nTo migrate existing projects: `npx shadcn@latest migrate radix`. After migration, remove unused `@radix-ui/react-*` packages from `package.json`.\n\n## Base UI Support (January 2026)\n\nshadcn/ui now supports **Base UI** as an alternative to Radix UI for the underlying primitive library. Components look and behave the same way regardless of which library you choose — only the underlying implementation changes.\n\nChoose during init: `npx shadcn@latest init --base base-ui`\n\nThe CLI pulls the correct component variant based on your project configuration automatically.\n\n## Configuration (components.json)\n\nThe `components.json` file configures how shadcn/ui works in your project:\n\n```json\n{\n \"$schema\": \"https://ui.shadcn.com/schema.json\",\n \"style\": \"new-york\",\n \"rsc\": true,\n \"tsx\": true,\n \"tailwind\": {\n \"config\": \"tailwind.config.ts\",\n \"css\": \"src/app/globals.css\",\n \"baseColor\": \"zinc\", // Options: gray, neutral, slate, stone, zinc, mauve, olive, mist, taupe\n \"cssVariables\": true\n },\n \"aliases\": {\n \"components\": \"@/components\",\n \"utils\": \"@/lib/utils\",\n \"ui\": \"@/components/ui\",\n \"lib\": \"@/lib\",\n \"hooks\": \"@/hooks\"\n },\n \"registries\": {\n \"v0\": {\n \"url\": \"https://v0.dev/chat/api/registry\"\n },\n \"ai-elements\": {\n \"url\": \"https://elements.ai-sdk.dev/api/registry\"\n }\n }\n}\n```\n\n### Namespaced Registries\n\nConfigure multiple registries for your project:\n\n```json\n{\n \"registries\": {\n \"acme\": {\n \"url\": \"https://acme.com/registry/{name}.json\"\n },\n \"private\": {\n \"url\": \"https://internal.company.com/registry/{name}.json\",\n \"headers\": {\n \"Authorization\": \"Bearer ${REGISTRY_TOKEN}\"\n }\n }\n }\n}\n```\n\nInstall using namespace syntax:\n\n```bash\nnpx shadcn@latest add @acme/header @private/auth-form\n```\n\n## Theming\n\n### CSS Variables\n\nshadcn/ui uses CSS custom properties for theming, defined in `globals.css`:\n\n```css\n@theme inline {\n --color-background: oklch(0.145 0 0);\n --color-foreground: oklch(0.985 0 0);\n --color-card: oklch(0.205 0 0);\n --color-card-foreground: oklch(0.985 0 0);\n --color-primary: oklch(0.488 0.243 264.376);\n --color-primary-foreground: oklch(0.985 0 0);\n --color-secondary: oklch(0.269 0 0);\n --color-secondary-foreground: oklch(0.985 0 0);\n --color-muted: oklch(0.269 0 0);\n --color-muted-foreground: oklch(0.708 0 0);\n --color-accent: oklch(0.269 0 0);\n --color-accent-foreground: oklch(0.985 0 0);\n --color-destructive: oklch(0.396 0.141 25.723);\n --color-border: oklch(0.269 0 0);\n --color-input: oklch(0.269 0 0);\n --color-ring: oklch(0.488 0.243 264.376);\n --radius: 0.625rem;\n /* CLI v4: radius tokens use multiplicative calc instead of additive */\n --radius-xs: calc(var(--radius) * 0.5);\n --radius-sm: calc(var(--radius) * 0.75);\n --radius-md: calc(var(--radius) * 0.875);\n --radius-lg: var(--radius);\n --radius-xl: calc(var(--radius) * 1.5);\n}\n```\n\n### Dark Mode\n\nFor dark mode, use the `dark` class on `<html>`:\n\n```tsx\n// app/layout.tsx\n<html lang=\"en\" className=\"dark\">\n```\n\nOr use next-themes for toggling:\n\n```tsx\nimport { ThemeProvider } from 'next-themes'\n\n<ThemeProvider attribute=\"class\" defaultTheme=\"dark\">\n {children}\n</ThemeProvider>\n```\n\n### Custom Colors\n\nAdd application-specific colors alongside shadcn defaults:\n\n```css\n@theme inline {\n /* shadcn defaults above... */\n\n /* Custom app colors */\n --color-priority-urgent: oklch(0.637 0.237 15.163);\n --color-priority-high: oklch(0.705 0.213 47.604);\n --color-status-done: oklch(0.723 0.219 149.579);\n}\n```\n\nUse in components:\n\n```tsx\n<span className=\"text-[var(--color-priority-urgent)]\">Urgent</span>\n// Or with Tailwind v4 theme():\n<span className=\"text-priority-urgent\">Urgent</span>\n```\n\n## Most Common Components\n\n| Component | Use Case |\n|-----------|----------|\n| `button` | Actions, form submission |\n| `card` | Content containers |\n| `dialog` | Modals, confirmation prompts |\n| `input` / `textarea` | Form fields |\n| `select` | Dropdowns |\n| `table` | Data display |\n| `tabs` | View switching |\n| `command` | Command palette (Cmd+K) |\n| `dropdown-menu` | Context menus |\n| `popover` | Floating content |\n| `tooltip` | Hover hints |\n| `badge` | Status indicators |\n| `avatar` | User profile images |\n| `scroll-area` | Scrollable containers |\n| `separator` | Visual dividers |\n| `label` | Form labels |\n| `sheet` | Slide-out panels |\n| `skeleton` | Loading placeholders |\n\n## Design Direction for shadcn on Vercel\n\nshadcn/ui is not only a component source generator. In the Vercel stack it is the default interface language. Do not stop at \"the component works.\" Compose pages that feel deliberate, high-signal, and consistent.\n\n### Default aesthetic for product UI\n\n- Prefer style: `new-york` for product, dashboard, AI, and admin surfaces.\n- Default to dark mode for dashboards, AI apps, internal tools, settings, and developer-facing products. Use light mode only when the product is clearly content-first or editorial.\n- Use Geist Sans for interface text and Geist Mono for code, metrics, IDs, timestamps, commands.\n- Prefer zinc, neutral, or slate as the base palette. Use one accent color through `--color-primary`.\n- Build core surfaces from tokens: `bg-background`, `bg-card`, `text-foreground`, `text-muted-foreground`, `border-border`, `ring-ring`. Avoid ad-hoc hex values.\n- Keep radius consistent. The default `--radius: 0.625rem` is a strong baseline.\n- Use one density system per page: comfortable (`gap-6` / `p-6` / `text-sm`) or compact (`gap-4` / `p-4` / `text-sm`).\n- Keep icons quiet and consistent. Lucide icons at `h-4 w-4` or `h-5 w-5`.\n\n### Reach for this first\n\n| Use case | Reach for this first | Why |\n|----------|----------------------|-----|\n| Settings page | `Tabs` + `Card` + `Form` | Clear information grouping with predictable save flows |\n| Data dashboard | `Card` + `Badge` + `Table` + `DropdownMenu` | Covers summary, status, dense data, and row actions without custom shells |\n| CRUD table | `Table` + `DropdownMenu` + `Sheet` + `AlertDialog` | Supports browse, act, edit, and destructive confirmation in a standard pattern |\n| Auth screen | `Card` + `Label` + `Input` + `Button` + `Alert` | Keeps entry flows focused and gives errors a proper treatment |\n| Global search | `Command` + `Dialog` | Fast keyboard-first discovery with an established interaction model |\n| Mobile nav | `Sheet` + `Button` + `Separator` | Provides a compact navigation shell that adapts cleanly to small screens |\n| Detail page | header + `Badge` + `Separator` + `Card` | Balances hierarchy, metadata, and supporting content without over-nesting |\n| Filters | `Card` sidebar + `Sheet` + `Select` | Works for persistent desktop filters and collapsible mobile controls |\n| Empty/loading/error states | `Card` + `Skeleton` + `Alert` | Gives non-happy paths a designed surface instead of placeholder text |\n\n### Composition recipes\n\n- Settings page: `Tabs` + `Card` per group + `Separator` + save action\n- Admin dashboard: summary `Card`s + filter bar + `Table`\n- Entity detail: header + status `Badge` + main `Card` + side `Card` + `AlertDialog` for destructive\n- Search-heavy: `Command` for quick find, `Popover` for pickers, `Sheet` for mobile filters\n- Auth/onboarding: centered `Card` + social `Separator` + inline `Alert` for errors\n- Destructive flows: `AlertDialog` (not `Dialog`) for confirmation\n\n### Anti-patterns to avoid\n\n- Raw `button` / `input` / `select` / `div` when shadcn primitives exist\n- Repeated `div rounded-xl border p-6` instead of `Tabs` / `Table` / `Sheet` / `Dialog`\n- Multiple accent colors fighting each other\n- Nested cards inside cards inside cards\n- Large gradient backgrounds and glassmorphism on every surface\n- Mixing arbitrary spacing and radius values\n- Using `Dialog` for destructive confirmation instead of `AlertDialog`\n- Shipping empty/loading/error states without design treatment\n- Using ad-hoc Tailwind palette classes for foundational surfaces instead of theme tokens\n\n## Building a Custom Registry\n\nCreate your own component registry to share across projects:\n\n### Registry Types (CLI v4)\n\n| Type | Purpose |\n|------|---------|\n| `registry:ui` | Individual UI components |\n| `registry:base` | Full design system payload — components, deps, CSS vars, fonts, config |\n| `registry:font` | Font configuration as a first-class registry item |\n\n### 1. Define registry.json\n\n```json\n[\n {\n \"name\": \"my-component\",\n \"type\": \"registry:ui\",\n \"title\": \"My Component\",\n \"description\": \"A custom component\",\n \"files\": [\n {\n \"path\": \"components/my-component.tsx\",\n \"type\": \"registry:ui\"\n }\n ],\n \"dependencies\": [\"lucide-react\"]\n }\n]\n```\n\n### 2. Build\n\n```bash\nnpx shadcn@latest build\n# Outputs to public/r/my-component.json\n```\n\n### 3. Consume\n\n```bash\nnpx shadcn@latest add https://your-domain.com/r/my-component.json\n```\n\n## Component Gotchas\n\n### `shadcn init` Breaks Geist Font in Next.js (Tailwind v4)\n\n`shadcn init` rewrites `globals.css` and may introduce `--font-sans: var(--font-sans)` — a circular self-reference that breaks font loading. Tailwind v4's `@theme inline` resolves CSS custom properties at **parse time**, not runtime — so even `var(--font-geist-sans)` won't work because Next.js injects that variable via className at runtime.\n\n**The fix**: Use literal font family names in `@theme inline`:\n\n```css\n/* In @theme inline — CORRECT (literal names) */\n--font-sans: \"Geist\", \"Geist Fallback\", ui-sans-serif, system-ui, sans-serif;\n--font-mono: \"Geist Mono\", \"Geist Mono Fallback\", ui-monospace, monospace;\n\n/* WRONG — circular, resolves to nothing */\n--font-sans: var(--font-sans);\n\n/* ALSO WRONG — @theme inline can't resolve runtime CSS variables */\n--font-sans: var(--font-geist-sans);\n```\n\n**After running `shadcn init`**, always:\n1. Replace font declarations in `@theme inline` with literal Geist font names (as shown above)\n2. Move the font variable classNames from `<body>` to `<html>` in `layout.tsx`:\n\n```tsx\n// layout.tsx — font variables on <html>, not <body>\n<html lang=\"en\" className={`${geistSans.variable} ${geistMono.variable}`}>\n <body className=\"antialiased\">\n```\n\n### Avatar Has No `size` Prop\n\nThe shadcn Avatar component does **not** accept a `size` variant prop. Control size with Tailwind classes:\n\n```tsx\n// WRONG — no size variant exists\n<Avatar size=\"lg\" /> // ❌ TypeScript error / silently ignored\n\n// CORRECT — use Tailwind\n<Avatar className=\"h-12 w-12\">\n <AvatarImage src={user.image} />\n <AvatarFallback>JD</AvatarFallback>\n</Avatar>\n\n// Small avatar\n<Avatar className=\"h-6 w-6\"> ... </Avatar>\n```\n\nThis applies to most shadcn components — they use Tailwind classes for sizing, not variant props. If you need reusable size variants, add them yourself via `cva` in the component source.\n\n## Common Patterns\n\n### cn() Utility\n\nAll shadcn components use the `cn()` utility for conditional class merging:\n\n```ts\nimport { clsx, type ClassValue } from 'clsx'\nimport { twMerge } from 'tailwind-merge'\n\nexport function cn(...inputs: ClassValue[]) {\n return twMerge(clsx(inputs))\n}\n```\n\n### Extending Components\n\nSince you own the source code, extend components directly:\n\n```tsx\n// components/ui/button.tsx — add your custom variant\nconst buttonVariants = cva('...', {\n variants: {\n variant: {\n default: '...',\n destructive: '...',\n // Add custom variants\n success: 'bg-green-600 text-white hover:bg-green-700',\n premium: 'bg-gradient-to-r from-purple-500 to-pink-500 text-white',\n },\n },\n})\n```\n\n### Wrapping with TooltipProvider\n\nMany components require `TooltipProvider` at the root:\n\n```tsx\n// app/layout.tsx\nimport { TooltipProvider } from '@/components/ui/tooltip'\n\nexport default function RootLayout({ children }) {\n return (\n <html lang=\"en\" className=\"dark\">\n <body>\n <TooltipProvider>{children}</TooltipProvider>\n </body>\n </html>\n )\n}\n```\n\n## Framework Support\n\n- **Next.js** — Full support (App Router + Pages Router)\n- **Vite** — Full support\n- **React Router** — Full support\n- **Astro** — Full support\n- **Laravel** — Full support (via Inertia)\n- **TanStack Start** — Full support\n\n## Presets (CLI v4)\n\nPresets bundle your entire design system config (colors, theme, icon library, fonts, radius) into a single shareable code. One string configures everything:\n\n```bash\n# Apply a preset during init\nnpx shadcn@latest init --preset <code>\n\n# Switch presets in an existing project (reconfigures everything including components)\nnpx shadcn@latest init --preset <code>\n```\n\nBuild custom presets on `shadcn/create` — preview how colors, fonts, and radius apply to real components before publishing.\n\n## RTL Support (2026)\n\nThe CLI handles RTL transformation at install time:\n\n```bash\nnpx shadcn@latest migrate rtl\n```\n\nConverts directional classes (`ml-4`, `left-2`) to logical properties (`ms-4`, `start-2`) automatically.\n\n## Official Documentation\n\n- [shadcn/ui](https://ui.shadcn.com)\n- [Components](https://ui.shadcn.com/docs/components)\n- [CLI](https://ui.shadcn.com/docs/cli)\n- [Theming](https://ui.shadcn.com/docs/theming)\n- [Custom Registry](https://ui.shadcn.com/docs/registry)\n- [Registry Directory](https://ui.shadcn.com/docs/directory)\n- [GitHub: shadcn/ui](https://github.com/shadcn-ui/ui)\n"
}SHA-256: c3202ca629832c650cd9be37dd2d20dabfc2001efc4038c573cd5dc3460d7e14