shadcn

Guides shadcn/ui CLI usage, component installation, theming, and custom registry workflows.

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

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve? Working with shadcn/ui involves non-obvious CLI behaviors (interactive prompts, deprecated flags, font-breaking init side effects) and composition decisions that are easy to get wrong. This Skill provides expert guidance so you initialize projects correctly, install and compose components following design-system best practices, and avoid common pitfalls. ## Core Features & Use Cases - CLI Mastery: Correct non-interactive usage of init, add, build, search, view, docs, and migrate commands, including CLI v4 changes like presets, Base UI support, and the unified radix-ui package. - Theming & Configuration: Set up components.json, CSS variable themes, dark mode, custom colors, and namespaced registries with authentication. - Composition Patterns: Opinionated recipes for dashboards, settings pages, CRUD tables, auth screens, and command palettes, plus anti-patterns to avoid. - Use Case: You are scaffolding a Next.js admin dashboard. The Skill tells you to run npx shadcn@latest init -d, fix the Geist font issue in globals.css, add card, table, and dropdown-menu components, and compose them using the recommended dashboard pattern. ## Quick Start Ask the assistant to initialize shadcn/ui in your Next.js project and add the button, card, and dialog components with dark mode theming.

Frequently Asked Questions about shadcn

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I run shadcn init non-interactively?

Use `npx shadcn@latest init -d` to skip all interactive prompts with default configuration. The `-y` flag alone is not sufficient because it still prompts for component library selection; `-d` is required for CI and agent-driven workflows.

How do I add shadcn components to my project?

Run `npx shadcn@latest add` followed by component names, such as `npx shadcn@latest add button dialog card`. The CLI copies component source code into your project rather than installing a package, giving you full ownership of the code.

Does shadcn/ui support Base UI instead of Radix UI?

Yes, shadcn/ui supports Base UI as an alternative primitive library since January 2026. Choose it during initialization with `npx shadcn@latest init --base base-ui`; components look and behave the same regardless of the underlying library.

Why does shadcn init break Geist font in Next.js?

The init command rewrites globals.css and can introduce a circular `--font-sans: var(--font-sans)` reference, and Tailwind v4's `@theme inline` cannot resolve runtime CSS variables. Fix it by using literal font family names in `@theme inline` and moving font variable classNames to the `<html>` element.

How do I create a custom shadcn registry?

Define a registry.json file listing your components with types like `registry:ui`, then run `npx shadcn@latest build` to generate distributable JSON files. Consumers install items with `npx shadcn@latest add` pointing at your registry URL or namespace.

Why does the shadcn Avatar size prop not work?

The Avatar component has no `size` variant prop; passing one causes a TypeScript error or is silently ignored. Control sizing with Tailwind classes like `className="h-12 w-12"`, or add custom variants yourself via `cva` in the component source.