shadcn

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

Updated Mar 24, 2026
One-click install
npx skills add https://github.com/Ssrrb/cerramos-codebase --skill shadcn-ssrrb
Or copy as Structured Prompt for Agent▼
Please help me install this Agent Skill.
Skill: shadcn
Source: https://github.com/Ssrrb/cerramos-codebase/tree/main/.agents/skills/shadcn
Command: npx skills add https://github.com/Ssrrb/cerramos-codebase --skill shadcn-ssrrb

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve? Working with shadcn/ui requires knowing the correct CLI commands, component composition rules, and project-specific configuration (aliases, icon library, base vs radix primitives). This Skill injects project context and enforces correct patterns so components are added, updated, and styled without guesswork or broken code. ## Core Features & Use Cases - Component lifecycle management: Search registries, add components, preview changes with --dry-run/--diff, and smart-merge upstream updates while preserving local modifications. - Enforced composition and styling rules: Built-in Incorrect/Correct rule files cover forms (FieldGroup/Field), icons (data-icon), semantic colors, spacing (gap-*), and base-vs-radix API differences. - Preset and theme workflows: Initialize projects with named presets or preset codes, switch presets via reinstall/merge/skip strategies, and customize themes through CSS variables. - Use Case: When asked to build a settings form, the Skill checks installed components, fetches official docs via npx shadcn@latest docs, and generates code using FieldGroup, ToggleGroup, and proper validation attributes matching the project's configuration. ## Quick Start Ask the assistant to add a shadcn/ui component such as a dialog or build a form, and it will use the shadcn CLI with the correct project context and rules.

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 my customizations?▼

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 manually where you have 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, which changes component APIs. Radix uses asChild and type="single"/"multiple" props, while base uses render, a multiple boolean, items props on Select, and scalar Slider values.

Does shadcn/ui work with monorepos and different frameworks?▼

Yes, the CLI supports monorepo scaffolding via the --monorepo flag for next, vite, start, react-router, and astro templates. Laravel templates do not support monorepos. Use npx shadcn@latest init --name my-app --preset base-nova --monorepo to scaffold.

Why should I avoid space-y-* and raw colors in shadcn/ui code?▼

The skill's styling rules require gap-* with flex layouts instead of space-x-*/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.

How do I switch shadcn presets on an existing project?▼

Choose reinstall, merge, or skip. Reinstall overwrites all components with init --preset <code> --force --reinstall; merge uses --no-reinstall then smart-merges each component; skip updates only config and CSS. Never decode preset codes manually—pass them directly to the CLI.