Skip to content
Development
Skill

/shadcn-ui

Provides complete shadcn/ui component library patterns including installation, configuration, and implementation of accessible React components. Use when setting up shadcn/ui, installing components, building forms with React Hook Form and Zod, customizing themes with Tailwind

From plugin
shep
27019 skills10 agents

Claude Code

$ npx -y skills add shep-ai/shep --skill shadcn-ui --agent claude-code

SKILL.md

shadcn-ui.SKILL.md
name: shadcn-ui
description: Provides complete shadcn/ui component library patterns including installation, configuration, and implementation of accessible React components. Use when setting up shadcn/ui, installing components, building forms with React Hook Form and Zod, customizing themes with Tailwind CSS, or implementing UI patterns like buttons, dialogs, dropdowns, tables, and complex form layouts.

shadcn/ui Component Patterns

Overview

Expert guide for building accessible, customizable UI components with shadcn/ui, Radix UI, and Tailwind CSS. This skill provides comprehensive patterns for implementing production-ready components with full accessibility support.

Table of Contents

  • [When to Use](#when-to-use)
  • [Quick Start](#quick-start)
  • [Installation & Setup](#installation--setup)
  • [Project Configuration](#project-configuration)
  • [Core Components](#core-components)
  • [Button](#button-component)
  • [Input & Form Fields](#input--form-fields)
  • [Forms with Validation](#forms-with-validation)
  • [Card](#card-component)
  • [Dialog (Modal)](#dialog-modal-component)
  • [Select (Dropdown)](#select-dropdown-component)
  • [Sheet (Slide-over)](#sheet-slide-over-component)
  • [Menubar & Navigation](#menubar--navigation)
  • [Table](#table-component)
  • [Toast Notifications](#toast-notifications)
  • [Advanced Patterns](#advanced-patterns)
  • [Customization](#customization)
  • [Next.js Integration](#nextjs-integration)
  • [Best Practices](#best-practices)
  • [Common Component Combinations](#common-component-combinations)

When to Use

  • Setting up a new project with shadcn/ui
  • Installing or configuring individual components
  • Building forms with React Hook Form and Zod validation
  • Creating accessible UI components (buttons, dialogs, dropdowns, sheets)
  • Customizing component styling with Tailwind CSS
  • Implementing design systems with shadcn/ui
  • Building Next.js applications with TypeScript
  • Creating complex layouts and data displays

Instructions

1. **Initialize Project**: Run `npx shadcn@latest init` to configure shadcn/ui 2. **Install Components**: Add components with `npx shadcn@latest add <component>` 3. **Configure Theme**: Customize CSS variables in globals.css for theming 4. **Import Components**: Use components from `@/components/ui/` directory 5. **Customize as Needed**: Modify component code directly in your project 6. **Add Form Validation**: Integrate React Hook Form with Zod schemas 7. **Test Accessibility**: Verify ARIA attributes and keyboard navigation

Examples

Complete Form with Validation

'use client';

import { zodResolver } from '@hookform/resolvers/zod';
import { useForm } from 'react-hook-form';
import { z } from 'zod';
import { Button } from '@/components/ui/button';
import {
  Form,
  FormControl,
  FormField,
  FormItem,
  FormLabel,
  FormMessage,
} from '@/components/ui/form';
import { Input } from '@/components/ui/input';

const formSchema = z.object({
  email: z.string().email('Invalid email'),
  password: z.string().min(8, 'Password must be at least 8 characters'),
});

export function LoginForm() {
  const form = useForm<z.infer<typeof formSchema>>({
    resolver: zodResolver(formSchema),
    defaultValues: { email: '', password: '' },
  });

  return (
    <Form {...form}>
      <form onSubmit={form.handleSubmit(console.log)} className="space-y-4">
        <FormField
          name="email"
          render={({ field }) => (
            <FormItem>
              <FormLabel>Email</FormLabel>
              <FormControl>
                <Input type="email" {...field} />
              </FormControl>
              <FormMessage />
            </FormItem>
          )}
        />
        <Button type="submit">Login</Button>
      </form>
    </Form>
  );
}

Constraints and Warnings

  • **Not an NPM Package**: Components are copied to your project; you own the code
  • **Client Components**: Most components require "use client" directive
  • **Radix Dependencies**: Ensure all @radix-ui packages are installed
  • **Tailwind Required**: Components rely on Tailwind CSS utilities
  • **TypeScript**: Designed for TypeScript projects; type definitions included
  • **Path Aliases**: Configure @ alias in tsconfig.json for imports
  • **Dark Mode**: Set up dark mode with CSS variables or class strategy

Quick Start

For new projects, use the automated setup:

# Create Next.js project with shadcn/ui
npx create-next-app@latest my-app --typescript --tailwind --eslint --app
cd my-app
npx shadcn@latest init

# Install essential components
npx shadcn@latest add button input form card dialog select

For existing projects:

# Install dependencies
npm install tailwindcss-animate class-variance-authority clsx tailwind-merge lucide-react

# Initialize shadcn/ui
npx shadcn@latest init

What is shadcn/ui?

shadcn/ui is **not** a traditional component library or npm package. Instead:

  • It's a **collection of reusable components** that you can copy into your project
  • Components are **yours to customize** - you own the code
  • Built with **Radix UI** primitives for accessibility
  • Styled with **Tailwind CSS** utilities
  • Includes CLI tool for easy component installation

Installation & Setup

Initial Setup

# Initialize shadcn/ui in your project
npx shadcn@latest init

During setup, you'll configure:

  • TypeScript or JavaScript
  • Style (Default, New York, etc.)
  • Base color theme
  • CSS variables or Tailwind CSS classes
  • Component installation path

Installing Individual Components

# Install a single component
npx shadcn@latest add button

# Install multiple components
npx shadcn@latest add button input form

# Install all components
npx shadcn@latest add --all

Manual Installation

If you prefer manual setup:

# Install dependencies for a specific component
npm install @radix-ui/react-slot

# Copy component code from ui.shadcn.com
# Place in src/components/ui/

##

Read more
@shep-ai
Ships withshep

Ship features 10x faster. Built In Auto: Memory, K8S Agent & Security (SDD+SDLC) . 😇

27019 skills10 agents
Get the whole plugin

Stars on GitHub

Momentum

stars in total
270
Star history of shep-ai/shep on GitHub, a chart by star-history.com

Other skills on shep.

architecture-reviewer

architecture-reviewer

Use when making architectural decisions, planning features, designing new components, reviewing PRs, or validating that proposed…

@shep-ai@shep-aiInstall Skill
cross-validate-artifacts

cross-validate-artifac…

Cross-validate documentation and artifacts across the codebase for consistency, conflicts, and contradictions. Use when users ask…

@shep-ai@shep-aiInstall Skill
mermaid-diagrams

mermaid-diagrams

Comprehensive guide for creating software diagrams using Mermaid syntax. Use when users need to create, visualize, or document…

@shep-ai@shep-aiInstall Skill
react-flow

react-flow

React Flow (@xyflow/react) for workflow visualization with custom nodes and edges. Use when building graph visualizations,…

@shep-ai@shep-aiInstall Skill
shep-kit-commit-pr

shep-kit-commit-pr

Use when ready to commit, push, and create a PR with CI verification. Triggers include "commit and pr", "push pr", "create pr",…

@shep-ai@shep-aiInstall Skill
shep-kit-fast-loop

shep-kit-fast-loop

Use when the user wants rapid implementation iteration without tests, builds, or commits. Triggers include "fast loop", "fast…

@shep-ai@shep-aiInstall Skill

More skills from other plugins.

brainstorming
Auto-invoked

brainstorming

You MUST use this before any creative work - creating features, building components, adding functionality, modifying behavior, or…

@obra@obraInstall Skill
ask-matt

ask-matt

Ask which skill or flow fits your situation. A router over the skills in this repo.

skills12d309k
@mattpocock@mattpocockInstall Skill
accessibility
Auto-invoked

accessibility

Design, implement, and audit accessible UI to WCAG 2.2 Level AA across Web, iOS, and Android — semantic ARIA roles and labels,…

ecc13d293k
@affaan-m@affaan-mInstall Skill
compiler-commit

compiler-commit

Use when you want to verify compiler changes and commit with the correct convention. Runs tests, lint, and format, then commits…

react3d252k
@facebook@facebookInstall Skill

Questions about shadcn-ui.

Which coding agents can use shadcn-ui?
shadcn-ui installs in Claude Code, Codex, Cursor, Gemini CLI, GitHub Copilot, OpenCode and Windsurf with the skills CLI, using each agent's flag shown on this page. Flowy's auto-invocation, which fires a skill when your prompt matches, runs in Claude Code only.