shadcn

Manages shadcn/ui components via CLI for adding, searching, updating, and composing UI.

Updated Mar 4, 2026
One-click install
npx skills add https://github.com/gmolike/Claude-Template --skill shadcn-gmolike
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: shadcn
Source: https://github.com/gmolike/Claude-Template/tree/main/.agents/skills/shadcn
Command: npx skills add https://github.com/gmolike/Claude-Template --skill shadcn-gmolike

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 eliminates guesswork by injecting live project context and enforcing correct usage patterns, preventing common mistakes like wrong imports, missing accessibility titles, or invalid styling. ## Core Features & Use Cases - Component Lifecycle Management: Search registries, add components, preview changes with dry-run and diff, and smart-merge upstream updates while preserving local modifications. - Enforced Best Practices: Critical rules for forms (FieldGroup/Field), composition (Groups, Titles, Card structure), icons (data-icon), and styling (semantic tokens, gap spacing) with Incorrect/Correct code pairs. - Preset & 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 current docs via the CLI, and generates code using FieldGroup, ToggleGroup, and proper validation attributes matching the project's radix or base configuration. ## Quick Start Ask the agent to add a shadcn/ui component such as a dialog or build a form following shadcn 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 use --dry-run or --diff to preview changes before writing files.

How do I update shadcn components without losing my customizations?

Use the smart merge workflow: run 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 props, multiple booleans, items arrays on Select, and scalar Slider values. Check the base field via npx shadcn@latest info.

Does shadcn/ui work with Vite and monorepos?

Yes, the CLI supports vite, next, start, react-router, and astro templates, all with monorepo scaffolding via the --monorepo flag. Laravel is supported but not for 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?

shadcn/ui conventions require gap-* utilities instead of space-x-*/space-y-* for spacing, and semantic tokens like bg-primary or text-muted-foreground instead of raw colors like bg-blue-500. Semantic tokens handle dark mode automatically through CSS variables, while raw values break theming.

How do I switch shadcn presets on an existing project?

Choose reinstall, merge, or skip: reinstall overwrites all components with the new preset, merge updates config then smart-merges each component individually, and skip only updates config and CSS variables. Run the init command with --preset <code> --force inside your project directory.