shadcn

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

Updated Jul 25, 2026
One-click install
npx skills add https://github.com/regisleandro/clara-financas --skill shadcn-regisleandro
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: shadcn
Source: https://github.com/regisleandro/clara-financas/tree/main/.agents/skills/shadcn
Command: npx skills add https://github.com/regisleandro/clara-financas --skill shadcn-regisleandro

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes references (resource) components.

What problem does it solve? Building UI with shadcn/ui requires knowing the correct component APIs, composition rules, Tailwind conventions, and CLI workflows. This Skill encodes those rules and drives the shadcn CLI so components are added, updated, and composed correctly instead of being hand-rolled or guessed. ## 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. - Enforced UI rules: Critical rules for forms (FieldGroup/Field), composition (Groups, Dialog titles, Card structure), icons (data-icon), styling (semantic tokens, gap-, size-), and chat primitives (MessageScroller, Bubble, Attachment, Marker). - Presets and theming: Init projects with named presets or preset codes, apply or merge presets, and customize CSS variables for Tailwind v3/v4. - Use Case: Ask to build a settings form in a Next.js shadcn project and get code using FieldGroup, ToggleGroup, data-invalid validation, and the project's configured icon library. ## Quick Start Ask the assistant to add a shadcn component or build a UI pattern, for example: add a dialog and card to my project and compose a profile editing form following the shadcn 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, 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. Merge manually where you have local edits, 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 theme?

Use npx shadcn@latest apply <code> to overwrite an existing project's preset, or init --preset <code> --force --no-reinstall to update only config and CSS. Inspect codes with preset decode and never decode preset strings manually.

Why should forms use FieldGroup and Field instead of divs?

FieldGroup and Field provide consistent layout, labeling, and validation wiring in shadcn/ui. Validation requires data-invalid on the Field and aria-invalid on the control, which raw div layouts with space-y-* do not provide.

Can I use community registries with the shadcn CLI?

Yes, the CLI supports namespaced registries configured in components.json and public GitHub registries via owner/repo addresses. After adding third-party items, verify imports match your project's aliases and icon library.