shadcn
БесплатноБез исполняемых скриптовНе проверенshadcn/ui expert guidance — CLI, component installation, composition patterns, custom registries, theming, Tailwind CSS integration, and high-quality…
от openai★ 8 494 звезды на GitHubОб этом скилле
shadcn/ui
You are an expert in shadcn/ui — a collection of beautifully designed, accessible, and customizable React components built on Radix UI primitives and Tailwind CSS. Components are added directly to your codebase as source code, not installed as a dependency.
Key Concept
shadcn/ui is not a component library in the traditional sense. You don't install it as a package. Instead, the CLI copies component source code into your project, giving you full ownership and customization ability.
CLI Commands
Initialize (non-interactive — ALWAYS use this)
IMPORTANT: shadcn init is interactive by default. Always use -d (defaults) for non-interactive initialization:
# Non-interactive init with defaults — USE THIS
npx shadcn@latest init -d
# Non-interactive with a preset (recommended for consistent design systems)
npx shadcn@latest init --preset <code> -f
# Non-interactive with explicit base library choice
npx shadcn@latest init -d --base radix
npx shadcn@latest init -d --base base-ui
# Scaffold a full project template (CLI v4)
AI Elements compatibility: Always use
--base radix(the default) when the project uses or may use AI Elements. AI Elements components rely on Radix APIs and have type errors with Base UI.
npx shadcn@latest init --template next -d
npx shadcn@latest init --template vite -d
Options:
-d, --defaults— Use default configuration, skip all interactive prompts (REQUIRED for CI/agent use)-y, --yes— Skip confirmation prompts (does NOT skip library selection — use-dinstead)-f, --force— Force overwrite existing configuration-t, --template— Scaffold full project template (next,vite,react-router,astro,laravel,tanstack-start)--preset— Apply a design system preset (colors, theme, icons, fonts, radius) as a single shareable code--base— Choose primitive library:radix(default) orbase-ui--monorepo— Set up a monorepo structure
WARNING:
-y/--yesalone does NOT make init fully non-interactive — it still prompts for component library selection. Always use-dto skip ALL prompts.
Deprecated in CLI v4:
--style,--base-color,--src-dir,--no-base-style, and--css-variablesflags are removed and will error. Theregistry:buildandregistry:mcpregistry types are also deprecated. Useregistry:baseandregistry:fontinstead.
The init command:
- Detects your framework (Next.js, Vite, React Router, Astro, Laravel, TanStack Start)
- Installs required dependencies (Radix UI, tailwind-merge, class-variance-authority)
- Creates
components.jsonconfiguration - Sets up the
cn()utility function - Configures CSS variables for theming
Add Components
# Add specific components
npx shadcn@latest add button dialog card
# Add all available components
npx shadcn@latest add --all
# Add from a custom registry
npx shadcn@latest add @v0/dashboard
npx shadcn@latest add @acme/custom-button
# Add from AI Elements registry
npx shadcn@latest add https://elements.ai-sdk.dev/api/registry/all.json
Options:
-o, --overwrite— Overwrite existing files-p, --path— Custom install path-a, --all— Install all components--dry-run— Preview what will be added without writing files--diff— Show diff of changes when updating existing components--view— Display a registry item's source code inline
Search & List
npx shadcn@latest search button
npx shadcn@latest list @v0
Build (Custom Registry)
npx shadcn@latest build
npx shadcn@latest build ./registry.json -o ./public/r
View, Info & Docs (CLI v4)
# View a registry item's source before installing
npx shadcn@latest view button
# Show project diagnostics — config, installed components, dependencies
npx shadcn@latest info
# Get docs, code, and examples for any component (agent-friendly output)
npx shadcn@latest docs button
npx shadcn@latest docs dialog
shadcn docsgives coding agents the context to use primitives correctly — returns code examples, API reference, and usage patterns inline.
Migrate
npx shadcn@latest migrate rtl # RTL support migration
npx shadcn@latest migrate radix # Migrate to unified radix-ui package
npx shadcn@latest migrate icons # Icon library changes
# Migrate components outside the default ui directory
npx shadcn@latest migrate radix src/components/custom
shadcn/skills (CLI v4)
shadcn/skills gives coding agents the context they need to work with components and registries correctly. It covers both Radix and Base UI primitives, updated APIs, component patterns, and registry workflows. The skill knows how to use the CLI, when to invoke it, and which flags to pass — so agents produce code that matches your design system.
Install: pnpm dlx skills add shadcn/ui
Unified Radix UI Package (February 2026)
The new-york style now uses a single radix-ui package instead
Установить shadcn в Claude Code и Claude Desktop
Зарегайся, чтобы установить скилл
Создай бесплатный аккаунт, чтобы открыть команду установки и сохранить скилл в библиотеку.
- Открой команду установки в одну строку
- Сохраняй скиллы в синхронизируемую библиотеку
- Уведомления, когда скиллы обновляются
Разрешённые инструменты
Инструменты, которые скиллу разрешено вызывать.
Без ограничений — скилл может использовать любой инструмент.
Вложенные файлы
FAQ
Что делает скилл shadcn?
shadcn/ui expert guidance — CLI, component installation, composition patterns, custom registries, theming, Tailwind CSS integration, and high-quality interface design. Use when initializing shadcn, adding components, composing product UI, building custom registries, configuring themes, or troubleshooting component issues.
Как установить скилл shadcn?
Скопируй папку скилла в ~/.claude/skills (вкладка Claude Code выше делает это одной командой), либо поставь как плагин.
Скилл shadcn запускает скрипты?
Нет, скилл состоит только из инструкций (SKILL.md), без исполняемых скриптов.
Похожие скиллы
frontend-design
Guidance for distinctive, intentional visual design when building new UI or reshaping an existing one. Helps with aesthetic direction, typography, and making…
от Anthropicwebapp-testing
Toolkit for interacting with and testing local web applications using Playwright. Supports verifying frontend functionality, debugging UI behavior, capturing…
от Anthropicbrand-guidelines
Applies Anthropic's official brand colors and typography to any sort of artifact that may benefit from having Anthropic's look-and-feel. Use it when brand…
от Anthropicweb-artifacts-builder
Suite of tools for creating elaborate, multi-component claude.ai HTML artifacts using modern frontend web technologies (React, Tailwind CSS, shadcn/ui). Use…
от Anthropic