shadcn-ui
What it does
This skill guides the use of shadcn/ui, a collection of ready-made interface components that you copy into your project. It is for frontend developers who want accessible components they can edit.
When to use it
- βWhen you want to add a button, dialog or menu from shadcn/ui to your app.
- βWhen you want to change the look or behavior of a shadcn component.
- βWhen you need to pick the right component for a screen.
Skill link
https://github.com/google-labs-code/stitch-skills/blob/main/plugins/stitch-build/skills/shadcn-ui/SKILL.mdCopy it and paste it into your AI (Claude, ChatGPT or Cursor), asking it to follow the instructions.
How to use
The easiest way: copy the message and paste it into your AI. It reads the skill and follows the instructions.
Ready-to-paste message
For Claude Code, Codex or Cursor: run it in your project folder and the skill gets installed.
Download the SKILL.md and drop it into your agentβs skills folder.
Example of what to ask your AI
βAdd a shadcn dialog and a data table to my React app and style them to match our brand colors.β
5 new skills a week. 1 minute to read.
How it works
It uses the shadcn tools to browse the component list and show examples, then adds the chosen components to your code for you to change.
Technical content (original SKILL.md)
Original text by the author, straight from GitHub.
shadcn/ui Component Integration
You are a frontend engineer specialized in building applications with shadcn/uiβa collection of beautifully designed, accessible, and customizable components built with Radix UI or Base UI and Tailwind CSS. You help developers discover, integrate, and customize components following best practices.
Core Principles
shadcn/ui is not a component libraryβit's a collection of reusable components that you copy into your project. This gives you:
- Full ownership: Components live in your codebase, not node_modules
- Complete customization: Modify styling, behavior, and structure freely, including choosing between Radix UI or Base UI primitives
- No version lock-in: Update components selectively at your own pace
- Zero runtime overhead: No library bundle, just the code you need
Component Discovery and Installation
1. Browse Available Components
Use the shadcn MCP tools to explore the component catalog and Registry Directory:
- List all components: Use
list_componentsto see the complete catalog - Get component metadata: Use
get_component_metadatato understand props, dependencies, and usage - View component demos: Use
get_component_demoto see implementation examples
2. Component Installation
There are two approaches to adding components:
A. Direct Installation (Recommended)
npx shadcn@latest add [component-name]
This command:
- Downloads the component source code (adapting to your config: Radix vs Base UI)
- Installs required dependencies
- Places files in
components/ui/ - Updates your
components.jsonconfig
B. Manual Integration
- Use
get_componentto retrieve the source code - Create the file in
components/ui/[component-name].tsx - Install peer dependencies manually
- Adjust imports if needed
3. Registry and Custom Registries
If working with a custom registry (defined in components.json) or exploring the Registry Directory:
- Use
get_project_registriesto list available registries - Use
list_items_in_registriesto see registry-specific components - Use
view_items_in_registriesfor detailed component information - Use
search_items_in_registriesto find specific components
Project Setup
Initial Configuration
For new projects, use the create command to customize everything (style, fonts, component library):
npx shadcn@latest create
For existing projects, initialize configuration:
npx shadcn@latest init
This creates components.json with your configuration:
- style: default, new-york (classic) OR choose new visual styles like Vega, Nova, Maia, Lyra, Mira
- baseColor: slate, gray, zinc, neutral, stone
- cssVariables: true/false for CSS variable usage
- tailwind config: paths to Tailwind files
- aliases: import path shortcuts
- rsc: Use React Server Components (yes/no)
- rtl: Enable RTL support (optional)
Required Dependencies
shadcn/ui components require:
- React (18+)
- Tailwind CSS (3.0+)
- Primitives: Radix UI OR Base UI (depending on your choice)
- class-variance-authority (for variant styling)
- clsx and tailwind-merge (for class composition)
Component Architecture
File Structure
src/
βββ components/
β βββ ui/ # shadcn components
β β βββ button.tsx
β β βββ card.tsx
β β βββ dialog.tsx
β βββ [custom]/ # your composed components
β βββ user-card.tsx
βββ lib/
β βββ utils.ts # cn() utility
βββ app/
βββ page.tsx
The cn() Utility
All shadcn components use the cn() helper for class merging:
import { clsx, type ClassValue } from "clsx"
import { twMerge } from "tailwind-merge"
export function cn(...inputs: ClassValue[]) {
return twMerge(clsx(inputs))
}
This allows you to:
- Override default styles without conflicts
- Conditionally apply classes
- Merge Tailwind classes intelligently
Customization Best Practices
1. Theme Customization
Edit your Tailwind config and CSS variables in app/globals.css:
@layer base {
:root {
--background: 0 0% 100%;
--foreground: 222.2 84% 4.9%;
--primary: 221.2 83.2% 53.3%;
/* ... more variables */
}
.dark {
--background: 222.2 84% 4.9%;
--foreground: 210 40% 98%;
/* ... dark mode overrides */
}
}
2. Component Variants
Use class-variance-authority (cva) for variant logic:
FAQ
Is shadcn/ui a package I install?
No, the components are copied into your project, so you own them and can change them.
What styling does it use?
The components are built with Tailwind CSS.
Are the components locked to a version?
No, the skill says there is no version lock-in, so you can update parts selectively.
Details
Original description by the author
Expert guidance for integrating and building applications with shadcn/ui components, including component discovery, installation, customization, and best practices.
Popularity
- GitHub stars
- 8.7k
- Ranking position
- #12340
- License
- Apache-2.0
- Updated
- 8/17/2026
Comments
- β¦
More skills from this repository
stitch::react-components
8.7kHelps your agent turn Stitch designs into React and Vite components, or update existing components to match the latest design, with checks.
stitch::react-native
8.7kHelps your agent convert Stitch web designs into React Native components for phone apps, or update existing mobile screens to match a newer design.
react-vite-dashboard
8.7kHelps your agent build data-heavy React and Vite dashboards from Stitch designs, with TanStack Query and design tokens from a DESIGN.md file.
stitch::code-to-design
8.7kHelps your agent move an existing web app, such as React, Vue or Angular, into a Stitch design so you can keep improving it there.
Similar skills
angular-developer
280kHelps your agent create Angular code and give project structure advice. Useful for starting new projects, creating code parts, or improving performance and accessibility.
frontend-a11y
280kHelps your agent make web interfaces accessible to everyone. It ensures websites and apps work well with screen readers and keyboard navigation.
frontend-patterns
280kHas your agent apply modern patterns in frontend development. It optimizes performance, manages state, and follows best practices in React and Next.js.