shadcn

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

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

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes references (resource) components.

What problem does it solve? Working with shadcn/ui involves many CLI commands, registry formats, preset codes, and strict composition and styling conventions that are easy to get wrong. This Skill provides the correct workflows, rules, and references for adding, searching, updating, styling, and composing shadcn/ui components so generated code follows the project's actual configuration. ## Core Features & Use Cases - Component Management: Search registries, preview changes with --dry-run/--diff, add components, and smart-merge upstream updates while preserving local modifications. - Project Context Awareness: Reads framework, aliases, Tailwind version, icon library, and base (radix vs base) from npx shadcn@latest info to generate code matching the project setup. - Preset Workflows: Initialize projects, apply preset codes, and switch presets with overwrite, partial, merge, or skip strategies. - Enforced UI Rules: Incorrect/Correct code pairs for forms, composition, styling, icons, and chat interfaces (MessageScroller, Bubble, Attachment, Marker). - Use Case: A developer asks to build a settings form in a Next.js shadcn project; the Skill ensures FieldGroup/Field layout, ToggleGroup for options, data-invalid validation, semantic colors, and the correct icon library. ## Quick Start Ask the assistant to add a shadcn/ui component such as a dialog or build a settings form using the shadcn CLI 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, registry-prefixed names like @magicui/shimmer-button, or GitHub addresses like owner/repo/item. Use --dry-run to preview changes and --diff to compare against existing files before writing.

How do I update shadcn components without losing my local changes?

Run npx shadcn@latest add <component> --dry-run to see affected files, then --diff <file> to inspect upstream changes per file. Overwrite files with no local changes and manually merge files you have customized, never using --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?

Use npx shadcn@latest apply <code> for existing projects or npx shadcn@latest init --preset <code> when initializing. Never decode preset codes manually; use preset decode, preset url, or preset resolve commands to inspect them.

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

The Skill's styling rules require flex with gap-* 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 in dark mode.

Can I use shadcn/ui with monorepos and frameworks other than Next.js?

Yes, templates include next, vite, start, react-router, and astro, all supporting the --monorepo flag, plus laravel without monorepo support. The CLI auto-detects the framework and package manager from the project.