Official agent skill

Integrating shadcn/ui Components

by google-labs-code in google-labs-code/stitch-skills

Guides finding, installing, customizing and wiring up shadcn/ui components in a project, with MCP tools for the component catalog and registries.

OfficialApache-2.0Auto-check: notesFrontend & Design

Install Integrating shadcn/ui Components

skills CLI
$ npx skills add google-labs-code/stitch-skills --skill shadcn-ui -a claude-code

Project install by default; add -g for ~/.claude/skills/.

GitHub CLI
$ gh skill install google-labs-code/stitch-skills shadcn-ui --agent claude-code

Project scope by default; add --scope user for a personal install. Needs GitHub CLI 2.90.0 or later (public preview).

Manual copy
$ git clone --depth 1 https://github.com/google-labs-code/stitch-skills.git skills-src && mkdir -p .claude/skills && cp -r skills-src/plugins/stitch-build/skills/shadcn-ui .claude/skills/shadcn-ui && rm -rf skills-src

Use ~/.claude/skills/ instead of .claude/skills for a personal install. The folder must contain SKILL.md.

Claude Code skills documentation · loads skills from .claude/skills/

Facts

Skill name
shadcn-ui
GitHub stars
8.4k
Used in
4 other repos
Token cost
~2.3k tokens
SKILL.md length
762 words
Files
10 (incl. scripts)
Skills in repo
7
Repo updated
First seen
Licence
Apache-2.0

At a glance

Guides finding, installing, customizing and wiring up shadcn/ui components in a project, with MCP tools for the component catalog and registries.

  • Works in 6 steps: Browse Available Components → Component Installation → Registry and Custom Registries → …
  • Adding a shadcn/ui component to a React project
  • SKILL.md covers Core Principles, Component Discovery and…, Project Setup and Component Architecture, plus 8 more sections
  • Runs Shell scripts from its folder; calls npx and tsc

What it does

The agent acts as a frontend engineer for shadcn/ui, which the skill describes as reusable components copied into your project rather than a library, so the code stays yours with no version lock-in and no runtime bundle. Discovery uses the shadcn MCP tools to list components, read metadata and view demos. Adding components goes through npx shadcn@latest add, which fetches the source, installs dependencies, places files in components/ui and updates components.json, or through manual integration from retrieved source.

Custom registries are handled with tools that list registries and items and view or search them. New projects start with npx shadcn@latest create and existing ones are initialized with a config step, with Radix UI or Base UI primitives as the choice. The folder includes a README, examples for an auth layout, a data table and a form pattern, guides for setup, customization, migration and the component catalog, and scripts/verify-setup.sh.

When your agent uses it

  • Adding a shadcn/ui component to a React project
  • Setting up shadcn/ui in a new or existing project
  • Customizing a component or switching between Radix UI and Base UI
  • Working with a custom component registry

Example prompts

  • “Add the dialog and data table components from shadcn/ui to this project.”
  • “Set up shadcn/ui in my existing app and verify the setup.”
  • “Build a login page layout with shadcn/ui form components.”

Requirements

  • npx, to run the shadcn command line tool
  • The shadcn MCP server, for component discovery
  • Pre-approved tools (allowed-tools): shadcn*:*, mcp_shadcn*, Read, Write, Bash, web_fetch

Workflow steps

6 steps, taken from the step headings in SKILL.md.

  1. Browse Available Components
  2. Component Installation
  3. Registry and Custom Registries
  4. Theme Customization
  5. Component Variants
  6. Extending Components

What it can do on your machine

Read from SKILL.md and the folder at commit 0337446. It shows what the files ask for, not the result of running them.

  • Tool permissions

    Pre-approves these tools, so the agent can use them without asking each time:

    • shadcn*:*
    • mcp_shadcn*
    • Read
    • Write
    • Bash
    • web_fetch

    From allowed-tools in the SKILL.md frontmatter.

  • Runs code

    Ships 1 file in scripts/ (Shell), which the agent can run.

    Shell commands in SKILL.md call:

    • npx
    • tsc

    From the folder's file list and the shell code blocks in SKILL.md.

  • Network

    No URLs in SKILL.md. Its commands use npx, which can reach the network depending on how they are called.

    From URLs in SKILL.md, links to its own repository left out.

  • Credentials

    Names no API keys, tokens, secrets or passwords.

    From names ending in _API_KEY, _TOKEN, _SECRET, _KEY or _PASSWORD in SKILL.md.

Context cost

Integrating shadcn/ui Components loads about 2.3k tokens when it runs. Until then it costs about 44 tokens; SKILL.md has 762 words of instructions outside code blocks.

Always · name and description, kept in context so the agent knows when to use it
~44
When it runs · the whole SKILL.md, loaded when a task matches
~2.3k

Estimates: characters ÷ 4, the usual rule of thumb; real counts depend on the model's tokenizer. Scripts and assets cost tokens only if the agent reads them.

Safety

Auto-check: notes

The automated check noted patterns worth knowing about, such as sudo or a known installer.

  • NotePre-approves every shell command (allowed-tools: Bash)SKILL.md
    allowed-tools: shadcn*:*, mcp_shadcn*, Read, Write, Bash, web_fetch

Automated static check — not a guarantee. Review scripts before installing. It scans the text of SKILL.md for risky patterns (piping downloads into a shell, reading credential files, hidden Unicode, destructive commands); the scripts in this folder are not scanned.

SKILL.md

The full file from google-labs-code/stitch-skills at commit 0337446, republished under its Apache-2.0 licence (© google-labs-code). 762 words, ~2,280 tokens.

Download SKILL.mdSave it as .claude/skills/shadcn-ui/SKILL.md (or your agent's skills folder). This skill also uses 9 other files; get the full folder from GitHub.
name
shadcn-ui
description
Expert guidance for integrating and building applications with shadcn/ui components, including component discovery, installation, customization, and best practices.
allowed-tools
shadcn*:*, mcp_shadcn*, Read, Write, Bash, web_fetch

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_components to see the complete catalog
  • Get component metadata: Use get_component_metadata to understand props, dependencies, and usage
  • View component demos: Use get_component_demo to see implementation examples
2. Component Installation

There are two approaches to adding components:

A. Direct Installation (Recommended)

bash
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.json config

B. Manual Integration

  1. Use get_component to retrieve the source code
  2. Create the file in components/ui/[component-name].tsx
  3. Install peer dependencies manually
  4. 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_registries to list available registries
  • Use list_items_in_registries to see registry-specific components
  • Use view_items_in_registries for detailed component information
  • Use search_items_in_registries to find specific components

Project Setup

Initial Configuration

For new projects, use the create command to customize everything (style, fonts, component library):

bash
npx shadcn@latest create

For existing projects, initialize configuration:

bash
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:

typescript
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:

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:

typescript
import { cva } from "class-variance-authority"

const buttonVariants = cva(
  "inline-flex items-center justify-center rounded-md",
  {
    variants: {
      variant: {
        default: "bg-primary text-primary-foreground",
        outline: "border border-input",
      },
      size: {
        default: "h-10 px-4 py-2",
        sm: "h-9 rounded-md px-3",
      },
    },
    defaultVariants: {
      variant: "default",
      size: "default",
    },
  }
)
3. Extending Components

Create wrapper components in components/ (not components/ui/):

typescript
// components/custom-button.tsx
import { Button } from "@/components/ui/button"
import { Loader2 } from "lucide-react"

export function LoadingButton({ 
  loading, 
  children, 
  ...props 
}: ButtonProps & { loading?: boolean }) {
  return (
    <Button disabled={loading} {...props}>
      {loading && <Loader2 className="mr-2 h-4 w-4 animate-spin" />}
      {children}
    </Button>
  )
}
Show full SKILL.md (319 more words)Show less

Blocks and Complex Components

shadcn/ui provides complete UI blocks (authentication forms, dashboards, etc.):

  1. List available blocks: Use list_blocks with optional category filter
  2. Get block source: Use get_block with the block name
  3. Install blocks: Many blocks include multiple component files

Blocks are organized by category:

  • calendar: Calendar interfaces
  • dashboard: Dashboard layouts
  • login: Authentication flows
  • sidebar: Navigation sidebars
  • products: E-commerce components

Accessibility

All shadcn/ui components are built on Radix UI primitives, ensuring:

  • Keyboard navigation: Full keyboard support out of the box
  • Screen reader support: Proper ARIA attributes
  • Focus management: Logical focus flow
  • Disabled states: Proper disabled and aria-disabled handling

When customizing, maintain accessibility:

  • Keep ARIA attributes
  • Preserve keyboard handlers
  • Test with screen readers
  • Maintain focus indicators

Common Patterns

Form Building
typescript
import { Button } from "@/components/ui/button"
import { Input } from "@/components/ui/input"
import { Label } from "@/components/ui/label"

// Use with react-hook-form for validation
import { useForm } from "react-hook-form"
Dialog/Modal Patterns
typescript
import {
  Dialog,
  DialogContent,
  DialogDescription,
  DialogHeader,
  DialogTitle,
  DialogTrigger,
} from "@/components/ui/dialog"
Data Display
typescript
import {
  Table,
  TableBody,
  TableCell,
  TableHead,
  TableHeader,
  TableRow,
} from "@/components/ui/table"

Troubleshooting

Import Errors
  • Check components.json for correct alias configuration
  • Verify tsconfig.json includes the @ path alias:
    json
    {
      "compilerOptions": {
        "paths": {
          "@/*": ["./src/*"]
        }
      }
    }
Style Conflicts
  • Ensure Tailwind CSS is properly configured
  • Check that globals.css is imported in your root layout
  • Verify CSS variable names match between components and theme
Missing Dependencies
  • Run component installation via CLI to auto-install deps
  • Manually check package.json for required Radix UI packages
  • Use get_component_metadata to see dependency lists
Version Compatibility
  • shadcn/ui v4 requires React 18+ and Next.js 13+ (if using Next.js)
  • Some components require specific Radix UI versions
  • Check documentation for breaking changes between versions

Validation and Quality

Before committing components:

  1. Type check: Run tsc --noEmit to verify TypeScript
  2. Lint: Run your linter to catch style issues
  3. Test accessibility: Use tools like axe DevTools
  4. Visual QA: Test in light and dark modes
  5. Responsive check: Verify behavior at different breakpoints

Resources

Refer to the following resource files for detailed guidance:

  • resources/setup-guide.md - Step-by-step project initialization
  • resources/component-catalog.md - Complete component reference
  • resources/customization-guide.md - Theming and variant patterns
  • resources/migration-guide.md - Upgrading from other UI libraries

Examples

See the examples/ directory for:

  • Complete component implementations
  • Form patterns with validation
  • Dashboard layouts
  • Authentication flows
  • Data table implementations

© google-labs-code, Apache-2.0. Rendered from Markdown: HTML in the file is shown as text, images as links, and headings moved down two levels. Raw file

Files

SKILL.md and 9 other files (scripts) in plugins/stitch-build/skills/shadcn-ui of google-labs-code/stitch-skills.

  • SKILL.md
  • README.md
  • examples/auth-layout.tsx
  • examples/data-table.tsx
  • examples/form-pattern.tsx
  • resources/component-catalog.md
  • resources/customization-guide.md
  • resources/migration-guide.md
  • resources/setup-guide.md
  • scripts/verify-setup.sh

Open the folder on GitHubat commit 0337446

Used in 4 other repositories

We found 7 copies of this SKILL.md (exact, near-identical or edited) in other folders, from 4 other GitHub owners. This page covers the copy in google-labs-code/stitch-skills, which our catalogue first saw on October 7, 2026.

Compare with similar skills

Integrating shadcn/ui Components next to the 5 skills that share the most tags, products or categories with it. Stars are the repository's; “used in” counts other GitHub owners with a copy.

Integrating shadcn/ui Components compared with similar skills
SkillStarsUsed inTokensAuto-checkLicenceRepo updated
Integrating shadcn/ui Components this skillgoogle-labs-code/stitch-skills8.4k4 repos~2.3kAutomated safety check: NotesApache-2.0
Web Artifacts Builderanthropics/skills180k40 repos~769Automated safety check: PassApache-2.0
UI StylingOhh-889/skyroc79513 repos~2.5kAutomated safety check: PassMIT
Creative Tim UI Blockscreativetimofficial/ui12k—~2.1kAutomated safety check: NotesMIT
Ss Learnbitjaru/styleseed970—~1.3kAutomated safety check: PassMIT
UI Design Systemtry-works/role-model117—~5kAutomated safety check: PassMIT

Similar skills

  • Web Artifacts Builder

    anthropics/skills

    Official

    Builds multi-component claude.ai HTML artifacts as a small React, TypeScript and Tailwind project, then bundles it into one shareable HTML file.

    180k GitHub starsUsed in 40 repos~769 tokens
    Frontend & DesignAuto-check passed
  • UI Styling

    Ohh-889/skyroc

    Create beautiful, accessible user interfaces with shadcn/ui components (built on Radix UI + Tailwind), Tailwind CSS utility-first styling, and canvas-based visual designs.

    795 GitHub starsUsed in 13 repos~2.5k tokens
    Frontend & DesignAuto-check passed
  • Creative Tim UI Blocks

    creativetimofficial/ui

    Helps install, generate and review Creative Tim UI blocks: shadcn/ui-based React and Tailwind sections that follow a restrained, production-minded design philosophy.

    12k GitHub stars~2.1k tokensUpdated 6 mo ago
    Frontend & DesignAuto-check: notes
  • Ss Learn

    bitjaru/styleseed

    Capture a human-approved UI design lesson as a privacy-minimized local StyleSeed candidate, review it, and prepare an opt-in share package without transmitting project code, prompts, screenshots, or…

    970 GitHub stars~1.3k tokensUpdated 6 days ago
    Frontend & DesignAuto-check passed
  • UI Design System

    try-works/role-model

    React UI component systems with TailwindCSS + Radix + shadcn/ui.

    117 GitHub stars~5k tokensUpdated today
    Frontend & DesignAuto-check passed
  • Shadcn Tailwind UI

    LiarMTTT/TavernWeave

    Build, restyle, or review accessible React interfaces that use shadcn/ui, Radix UI primitives, and Tailwind CSS.

    148 GitHub stars~1.7k tokensUpdated 3 days ago
    Frontend & DesignAuto-check passed

More from google-labs-code/stitch-skills

  • Stitch to Remotion Walkthrough Videos

    google-labs-code/stitch-skills

    Official

    Builds walkthrough videos from Stitch design projects using Remotion, with transitions, zoom effects and text overlays on each screen.

    8.4k GitHub starsUsed in 6 repos~3.2k tokens
    Auto-check: notes
  • Stitch Prompt Enhancer

    google-labs-code/stitch-skills

    Official

    Rewrites a vague UI generation idea into a structured, keyword-rich prompt for Stitch, pulling in an existing DESIGN.md design system when the project has one.

    8.4k GitHub starsUsed in 6 repos~1.7k tokens
    Auto-check passed
  • Stitch Taste Design System

    google-labs-code/stitch-skills

    Official

    Generates a DESIGN.md design-language file for Google Stitch that encodes color, typography, layout, component behavior and motion rules to avoid generic AI-looking UI.

    8.4k GitHub starsUsed in 15 repos~3.1k tokens
    Auto-check passed
  • Stitch Build Loop

    google-labs-code/stitch-skills

    Official

    Builds a website page by page with Stitch in an autonomous loop, passing a baton file from one iteration to the next that names the next page and prompt.

    8.4k GitHub starsUsed in 5 repos~2.6k tokens
    Auto-check: notes
  • Stitch to React and Vite Dashboard

    google-labs-code/stitch-skills

    Official

    Turns Stitch screens into a React, Vite and TypeScript dashboard with TanStack Query data fetching, DESIGN.md tokens as CSS variables and optional read-only Web3 data.

    8.4k GitHub stars~914 tokensUpdated 1 mo ago
    Auto-check: notes
  • Site Md

    google-labs-code/stitch-skills

    Official

    Analyze a project description or site requirements and synthesize a project constitution into SITE.md for the Stitch Build Loop

    8.4k GitHub stars~783 tokensUpdated 1 mo ago
    Auto-check passed

Questions about Integrating shadcn/ui Components

What does Integrating shadcn/ui Components do?

Guides finding, installing, customizing and wiring up shadcn/ui components in a project, with MCP tools for the component catalog and registries. The agent acts as a frontend engineer for shadcn/ui, which the skill describes as reusable components copied into your project rather than a library, so the code stays yours with no version lock-in and no runtime bundle. Discovery uses the shadcn MCP tools to list components, read metadata and view demos.

When should I use Integrating shadcn/ui Components?

Integrating shadcn/ui Components fits situations like: adding a shadcn/ui component to a React project; setting up shadcn/ui in a new or existing project; customizing a component or switching between Radix UI and Base UI; working with a custom component registry.

How do I install Integrating shadcn/ui Components in Claude Code?

Run `npx skills add google-labs-code/stitch-skills --skill shadcn-ui -a claude-code`. Or copy the skill folder (plugins/stitch-build/skills/shadcn-ui in google-labs-code/stitch-skills) into .claude/skills/shadcn-ui in your project. Claude Code loads it when a task matches its description.

How do I install Integrating shadcn/ui Components in Codex?

Run `npx skills add google-labs-code/stitch-skills --skill shadcn-ui -a codex`. Or copy the skill folder (plugins/stitch-build/skills/shadcn-ui in google-labs-code/stitch-skills) into .agents/skills/shadcn-ui in your project. Codex loads it when a task matches its description.

Can I use Integrating shadcn/ui Components in Cursor, Gemini CLI or GitHub Copilot?

Cursor, Gemini CLI, GitHub Copilot and OpenCode also load SKILL.md folders. With the skills CLI, run `npx skills add google-labs-code/stitch-skills --skill shadcn-ui -a cursor` (or -a gemini-cli, github-copilot or opencode for the others). To copy it by hand, put the folder in .cursor/skills/shadcn-ui, .gemini/skills/shadcn-ui, .github/skills/shadcn-ui and .opencode/skills/shadcn-ui in your project.

What does Integrating shadcn/ui Components need to run?

Going by SKILL.md and its folder, Integrating shadcn/ui Components needs a shell for the scripts in its folder and the command-line tools its instructions call (npx and tsc). Our summary lists: npx, to run the shadcn command line tool; The shadcn MCP server, for component discovery. Its frontmatter pre-approves these tools: shadcn*:*, mcp_shadcn*, Read, Write, Bash, web_fetch.

Does Integrating shadcn/ui Components access the network?

SKILL.md contains no URLs. Its commands use npx, which can reach the network depending on how they are called. This is read from the text; nothing was executed.

Is Integrating shadcn/ui Components safe to install?

Our automated static check of SKILL.md found notes only (pre-approves every shell command (allowed-tools: bash)), nothing it rates as a warning. It is not a guarantee. The check reads SKILL.md only: the scripts in the folder are not scanned, so read them before running anything.

What licence does Integrating shadcn/ui Components use?

Integrating shadcn/ui Components is published under the Apache-2.0 licence (the repository's licence). It allows redistribution, so the full SKILL.md is shown on this page.

How many tokens does Integrating shadcn/ui Components use?

About 2.3k tokens (SKILL.md is roughly 9.1k characters). Agents keep only the skill's name and description in context until a task matches; then they load SKILL.md in full.

What are the alternatives to Integrating shadcn/ui Components?

Skills that share tags, products or a category with Integrating shadcn/ui Components: Web Artifacts Builder (anthropics/skills, 180k stars), UI Styling (Ohh-889/skyroc, 795 stars), Creative Tim UI Blocks (creativetimofficial/ui, 12k stars) and Ss Learn (bitjaru/styleseed, 970 stars). The comparison table on this page puts their stars, adoption, token cost, safety result and licence side by side.

Who maintains Integrating shadcn/ui Components?

google-labs-code (a GitHub organization, an official publisher) maintains it in google-labs-code/stitch-skills, which has 8,431 GitHub stars. The repository holds 7 skills in this directory. The repository was last updated on August 17, 2026.

Source: google-labs-code/stitch-skills on GitHub. Facts on this page come from the repository at the commit we read; the author's words are quoted as theirs.