shadcn

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

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

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes references (resource) components.

What problem does it solve? Building UI with shadcn/ui requires knowing the correct component composition, CLI commands, preset handling, and styling conventions; this Skill encodes those rules so generated code follows official patterns instead of reinventing 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/skip strategies, and customize themes via CSS variables. - Enforced Composition Rules: Critical rules for forms (FieldGroup/Field), chat UI (MessageScroller/Bubble/Attachment/Marker), icons (data-icon), styling (semantic tokens, gap-*), and base-vs-radix API differences. - Use Case: Ask to build a settings form in a Next.js shadcn project and receive code using FieldGroup, ToggleGroup, data-invalid validation, and the project's actual aliases and 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 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 local changes?

Run npx shadcn@latest add <component> --dry-run to see affected files, then --diff <file> per file to compare upstream against local. Overwrite files with no local changes and manually merge files you customized; 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 and type="single"/"multiple" props, while base uses render, multiple booleans, items props on Select, and scalar Slider values.

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

Why should I avoid space-y-* and raw color classes in shadcn projects?

shadcn rules require flex with gap-* for spacing 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.

Can I use community registries with the shadcn CLI?

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