shadcn

Manages shadcn/ui components, registries, and styling rules for building React design systems.

1|Updated Aug 17, 2025
One-click install
npx skills add https://github.com/ratnesh-maurya/mdconverter --skill shadcn-ratnesh-maurya
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: shadcn
Source: https://github.com/ratnesh-maurya/mdconverter/tree/main/.claude/skills/shadcn
Command: npx skills add https://github.com/ratnesh-maurya/mdconverter --skill shadcn-ratnesh-maurya

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve? Building consistent UIs with shadcn/ui requires knowing the correct component composition, CLI commands, registry workflows, and styling conventions. This Skill provides the operational knowledge to add, update, debug, and style shadcn/ui components correctly without guessing APIs or violating design system rules. ## Core Features & Use Cases - Component Management: Search registries, add components, preview changes with dry-run and diff, and smart-merge upstream updates while preserving local modifications. - Enforced Styling Rules: Apply semantic color tokens, gap-based spacing, data-icon attributes, and correct form patterns (FieldGroup, Field, InputGroup) with Incorrect/Correct code pairs. - Project Context Awareness: Reads framework, Tailwind version, icon library, aliases, and base (radix vs base) from the CLI to generate code matching the project configuration. - Use Case: When asked to build a settings form in a Next.js app, the Skill checks installed components, fetches docs via the CLI, and produces code using FieldGroup, ToggleGroup, and proper validation states. ## Quick Start Ask the assistant to add a shadcn/ui component such as a dialog or build a form following shadcn/ui 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 the 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/ui 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 radix and base 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, multiple booleans, items props on Select, and scalar Slider values. Check the base field via npx shadcn@latest info.

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

shadcn/ui conventions 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. Semantic tokens handle dark mode automatically through CSS variables.

Can I use shadcn/ui with Tailwind CSS v4?

Yes, shadcn/ui supports both Tailwind v3 and v4. Check the tailwindVersion field from npx shadcn@latest info: v4 registers custom colors via @theme inline blocks in the global CSS file, while v3 uses tailwind.config.js.

How do I switch shadcn/ui presets on an existing project?

Run npx shadcn@latest init --preset <code> --force, then choose reinstall (overwrite all components), merge (smart-merge each installed component via --diff), or skip (update only config and CSS variables). Never decode preset codes manually; pass them directly to the CLI.