shadcn

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

Updated Aug 31, 2026
One-click install
npx skills add https://github.com/coleYab/usacr --skill shadcn-coleyab
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: shadcn
Source: https://github.com/coleYab/usacr/tree/main/.agents/skills/shadcn
Command: npx skills add https://github.com/coleYab/usacr --skill shadcn-coleyab

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes references (resource) components.

What problem does it solve? Building consistent React UI with shadcn/ui requires knowing the correct component APIs, composition rules, CLI commands, and preset workflows; this Skill provides that guidance so generated code follows official patterns instead of hand-rolled markup. ## Core Features & Use Cases - Component Management: Search registries, add components, preview changes with --dry-run/--diff, and smart-merge upstream updates while preserving local edits. - Preset & Theme Workflows: Initialize projects with named presets or preset codes, apply or switch presets with overwrite, partial, merge, or skip strategies. - Composition & Styling Rules: Enforces correct usage of FieldGroup, ToggleGroup, Dialog titles, semantic color tokens, gap-* spacing, and base-vs-radix API differences. - Use Case: When asked to build a settings form in a Next.js project, the Skill checks installed components via npx shadcn@latest info, fetches docs, and generates code using FieldGroup, Field validation states, and semantic tokens. ## Quick Start Ask the assistant to add a shadcn/ui component such as a dialog or build a form following shadcn/ui best practices in your project.

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 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 shadcn components without losing local changes?

Use npx shadcn@latest add <component> --dry-run to see affected files, then --diff <file> to compare upstream changes against your local version. Apply upstream updates per file while preserving local modifications, 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, and components like Select, ToggleGroup, Slider, and Accordion have different props between the two.

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 npx shadcn@latest init --preset <code> for new ones. Never decode preset codes manually; use preset decode, preset url, or preset resolve commands to inspect them.

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

Yes, the CLI supports templates for 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 projects?

The styling rules require flex with gap-* instead of space-y-*, 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 across light and dark modes.