shadcn

Manages shadcn/ui components, presets, and registries through the shadcn CLI.

1|1|Updated Jul 6, 2026
One-click install
npx skills add https://github.com/gabesan21/project-of-projects --skill shadcn-gabesan21
Or copy as Structured Prompt for Agent▼
Please help me install this Agent Skill.
Skill: shadcn
Source: https://github.com/gabesan21/project-of-projects/tree/main/.agents/skills/shadcn
Command: npx skills add https://github.com/gabesan21/project-of-projects --skill shadcn-gabesan21

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes references (resource) components.

What problem does it solve? Working with shadcn/ui requires knowing the correct CLI commands, component composition rules, and project configuration details. This Skill eliminates guesswork by injecting live project context and enforcing correct usage patterns for components, forms, styling, icons, and chat UI. ## Core Features & Use Cases - Component Management: Search registries, add components, preview changes with dry-run and diff, and smart-merge upstream updates while preserving local modifications. - Preset & Theme Control: Initialize projects with named presets or preset codes, apply or merge presets, and customize themes via CSS variables. - Enforced Best Practices: Critical rules for forms (FieldGroup/Field), composition (Groups, Titles, Card structure), styling (semantic tokens, gap spacing), icons (data-icon), and chat primitives (MessageScroller, Bubble, Attachment, Marker). - Use Case: When asked to build a settings form in a Next.js project, the Skill reads the project's components.json context, fetches component docs via the CLI, and generates code using FieldGroup, ToggleGroup, and proper validation attributes instead of raw divs and manual state. ## Quick Start Ask the agent to add a shadcn/ui component or build a UI pattern, for example: add a login form block to my project using the shadcn CLI.

Frequently Asked Questions about shadcn

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I add shadcn/ui components to my project?▼

Run npx shadcn@latest add followed by the component names, using your project's package runner (npx, pnpm dlx, or bunx). Check installed components first with npx shadcn@latest info, and preview changes with --dry-run or --diff before writing files.

How do I update a shadcn component without losing my local changes?▼

Use the smart merge workflow: run npx shadcn@latest add <component> --dry-run to see affected files, then --diff per file to compare upstream changes. Apply upstream updates manually where local modifications exist, and never use --overwrite without explicit approval.

What is the difference between base and radix in shadcn/ui?▼

The base field in components.json determines the primitive library and component APIs. Radix uses asChild for composition while base uses render; Select, ToggleGroup, Slider, and Accordion also have different props between the two. Check the base field via npx shadcn@latest info.

How do I apply or switch a shadcn preset code?▼

Pass the preset code directly to npx shadcn@latest apply <code> for existing projects or init --preset <code> for new ones. Never decode codes manually; use preset decode, preset url, or preset resolve to inspect them, and choose overwrite, partial, merge, or skip when switching.

Does shadcn/ui work with frameworks other than Next.js?▼

Yes, the CLI supports templates for Next.js, Vite, TanStack Start, React Router, Astro, and Laravel. All except Laravel support monorepo scaffolding via the --monorepo flag.

Why should I avoid space-y and raw color classes in shadcn/ui?▼

The skill's styling rules require flex with gap-* instead of space-y-*/space-x-*, and semantic tokens like bg-primary or text-muted-foreground instead of raw colors like bg-blue-500. This keeps components themeable through CSS variables and consistent in dark mode.