shadcn-component

Add shadcn/ui components to this project. Use when user mentions "add component", "install shadcn", "need a dialog/button/card", or references ui.shadcn.com.

⭐5stars🔀1forks📁View on GitHub🕐Updated Jan 11, 2026

When & Why to Use This Skill

The shadcn-component skill automates the integration of shadcn/ui components into React and Next.js projects. It streamlines frontend development by executing CLI commands, managing imports, and ensuring all UI elements adhere to specific project styling conventions like New York style, neutral colors, and glass-morphism. This skill eliminates manual boilerplate setup and ensures design consistency across the codebase.

Use Cases

  • Rapid UI Prototyping: Quickly build out complex interfaces by asking the agent to 'add a dialog' or 'install a tabs component' without leaving the chat interface.
  • Design System Enforcement: Automatically apply project-specific Tailwind CSS variables and custom classes (like glass-card or btn-press) to newly generated components.
  • Workflow Automation: Replace manual documentation lookups and terminal commands with natural language requests for installing and configuring UI primitives.
  • Dependency Management: Ensure correct installation of components via npx while maintaining project-specific preferences, such as using Sonner for notifications instead of the default shadcn toast.
nameshadcn-component
descriptionAdd shadcn/ui components to this project. Use when user mentions "add component", "install shadcn", "need a dialog/button/card", or references ui.shadcn.com.

Adding shadcn/ui Components

This project uses shadcn/ui with the following configuration (from components.json):

  • Style: New York
  • Base color: Neutral
  • CSS variables: enabled
  • Tailwind config: tailwind.config.ts
  • Components path: components/ui
  • Utils path: lib/utils

Instructions

  1. Install component using npx:

    npx shadcn@latest add <component-name>
    

    Common components: button, card, dialog, dropdown-menu, input, label, badge, alert, separator, scroll-area, sheet, skeleton, tooltip, tabs, switch, select, popover, progress, slider, accordion, avatar, checkbox, toast

  2. Component will be created at: components/ui/<component-name>.tsx

  3. Import pattern (follow existing style in app/page.tsx):

    import { Button } from '@/components/ui/button';
    import { Card, CardContent, CardHeader, CardTitle } from '@/components/ui/card';
    
  4. For toast notifications, this project uses Sonner (not shadcn toast):

    import { toast } from 'sonner';
    toast.success('Message here');
    toast.error('Error message');
    toast.info('Info message');
    

Project Styling Conventions

  • Glass-morphism: className="glass-card" (defined in globals.css)
  • Button interactions: className="btn-press" for press animation
  • Card hover: className="card-hover" for lift effect
  • Gradients: bg-gradient-to-r from-slate-700 to-slate-600
  • Backdrop blur: backdrop-blur-xl or backdrop-blur

Examples

  • "Add a tabs component" → npx shadcn@latest add tabs
  • "I need a modal" → npx shadcn@latest add dialog
  • "Add progress bar" → npx shadcn@latest add progress

Guardrails

  • Run npx shadcn@latest add (not manual creation) to ensure proper setup
  • Check components/ui/ for existing components before adding duplicates
  • Sonner is already installed for toasts - don't add shadcn toast
  • Confirm with user before running install command