Token导航 LogoToken导航TokenDH.com
前端设计只读github未标认证来源可访问许可证需确认审计通过

shadcn-uishadcn/ui 组件

Agent Skill

用于辅助界面设计、视觉规范、排版、配色、布局和交互体验优化。它适合让 Agent 根据产品场景整理页面结构、生成 UI 方案、检查视觉一致性或改进组件层级。使用时需要结合现有品牌、设计系统和用户任务,不应只堆装饰元素;涉及真实页面改动时,应通过截图或浏览器预览检查文本溢出、对齐和响应式表现。

总安装

699

周安装

28

GitHub Stars

12

下载量

226
CodexClaudeCursorGemini CLI

安装说明

本站只整理中文说明和来源信息,不托管安装包,也不代用户安装。

GitHub

来源数

2

许可证

unknown

最后核验

2026-05-01

来源状态

来源可访问

安装方式

通过对话安装

复制提示词发给支持本地命令或 Skills 的 AI 助手,先确认命令和权限,再让它执行。

请帮我安装这个 Agent Skill:shadcn-ui(shadcn/ui 组件)
来源仓库:https://github.com/claude-dev-suite/claude-dev-suite
仓库路径:skills/shadcn-ui
安装命令:
npx skills add https://github.com/claude-dev-suite/claude-dev-suite --skill shadcn-ui
安装前请先检查当前环境是否支持对应 CLI,并向我确认将要执行的命令、安装目录、联网范围和文件读写权限;确认后再执行。

命令行安装

复制命令到本机终端执行。该命令会通过 npx skills 从第三方来源获取 Skill;本站只展示命令,不托管安装包,也不自动执行。

skills.shnpx skills
npx skills add https://github.com/claude-dev-suite/claude-dev-suite --skill shadcn-ui

简介

用于辅助 shadcn/ui 组件集成与样式定制。

  • 适合生成按钮、卡片等基础组件代码。适用宿主包括 Codex、Claude、Cursor、Gemini CLI,接入前应确认版本、权限和运行环境要求。
  • 需结合 Tailwind CSS 与项目设计系统使用。
  • 组件改动应通过预览验证无障碍与响应式表现。
  • shadcn-ui 属于前端设计类 Skill,可作为该场景下的辅助能力补充。

SKILL.md

shadcn/ui Components

Full Reference: See advanced.md for accessibility patterns, virtualized tables, form integration with react-hook-form, testing patterns, and dark mode setup.

When NOT to Use This Skill

  • Radix UI primitives only - Use radix-ui skill for unstyled components
  • Custom component library - Build from scratch with Radix + Tailwind
  • Different UI framework - Material-UI, Chakra, Ant Design have own patterns
  • No Tailwind project - shadcn/ui requires Tailwind CSS

Installation

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

# Add components
npx shadcn@latest add button card dialog dropdown-menu form input table

Button Variants

import { Button } from '@/components/ui/button';

<Button variant="default">Primary</Button>
<Button variant="secondary">Secondary</Button>
<Button variant="destructive">Delete</Button>
<Button variant="outline">Outline</Button>
<Button variant="ghost">Ghost</Button>

// With icon
<Button>
  <PlusIcon className="mr-2 h-4 w-4" />
  Add Item
</Button>

// Loading state
<Button disabled={isLoading}>
  {isLoading && <Loader2 className="mr-2 h-4 w-4 animate-spin" />}
  Save
</Button>

Card Layout

import { Card, CardContent, CardHeader, CardTitle } from '@/components/ui/card';

<Card>
  <CardHeader>
    <CardTitle>User Profile</CardTitle>
  </CardHeader>
  <CardContent>
    {/* Content */}
  </CardContent>
</Card>

Dialog (Modal)

import { Dialog, DialogContent, DialogHeader, DialogTitle, DialogTrigger } from '@/components/ui/dialog';

<Dialog open={open} onOpenChange={setOpen}>
  <DialogTrigger asChild>
    <Button>Create User</Button>
  </DialogTrigger>
  <DialogContent>
    <DialogHeader>
      <DialogTitle>Create User</DialogTitle>
    </DialogHeader>
    <UserForm onSuccess={() => setOpen(false)} />
  </DialogContent>
</Dialog>

Data Table

import { Table, TableBody, TableCell, TableHead, TableHeader, TableRow } from '@/components/ui/table';

<Table>
  <TableHeader>
    <TableRow>
      <TableHead>Name</TableHead>
      <TableHead>Email</TableHead>
    </TableRow>
  </TableHeader>
  <TableBody>
    {users.map((user) => (
      <TableRow key={user.id}>
        <TableCell>{user.name}</TableCell>
        <TableCell>{user.email}</TableCell>
      </TableRow>
    ))}
  </TableBody>
</Table>

Utils (cn function)

// lib/utils.ts
import { clsx, type ClassValue } from 'clsx';
import { twMerge } from 'tailwind-merge';

export function cn(...inputs: ClassValue[]) {
  return twMerge(clsx(inputs));
}

// Usage
<div className={cn("base-class", isActive && "active-class")} />

Anti-Patterns

Anti-PatternWhy It's BadCorrect Approach
Modifying component files directlyLost on re-installWrap components or use variants
No DialogTitle/DialogDescriptionAccessibility issueAlways include for screen readers
Missing aria labelsNot accessibleAdd aria-label to interactive elements
Not using asChildExtra DOM nodesUse asChild to merge props
Hardcoding theme colorsCan't change themeUse CSS variables from globals.css

Quick Troubleshooting

IssueCauseSolution
Components not foundNot installedRun npx shadcn@latest add [component]
Styles not applyingGlobals.css not importedImport in layout/app
Dark mode not workingNo ThemeProviderWrap app in ThemeProvider
Type errorsMissing typesInstall @radix-ui/react-* peer deps
Dialog not closingNo controlled stateAdd open and onOpenChange props
Form validation not workingMissing zodResolverAdd resolver: zodResolver(schema)

Theme Configuration

/* index.css */
@layer base {
  :root {
    --background: 0 0% 100%;
    --foreground: 222.2 84% 4.9%;
    --primary: 222.2 47.4% 11.2%;
    /* ... more variables */
  }
  .dark {
    --background: 222.2 84% 4.9%;
    --foreground: 210 40% 98%;
  }
}

Monitoring Metrics

MetricTarget
Component bundle size< 50KB per component
First Input Delay< 100ms
Accessibility score100%
Form submission time< 300ms

Checklist

  • Accessible labels on all form fields
  • DialogTitle and DialogDescription present
  • aria-describedby for error messages
  • Loading states with aria-busy
  • Lazy loading for heavy components
  • Virtual scrolling for large lists
  • Form validation with Zod
  • Dark mode with next-themes
  • Component tests with Testing Library
  • Accessibility tests with jest-axe

Reference Documentation

适合场景

01

用户想查找某类 Agent Skill 时

02

需要根据任务场景推荐可安装能力包时

03

需要对比不同来源的安装命令和来源信息时

能力概览

能力 1

按任务关键词查找相关 Skills

能力 2

展示可复制的安装命令

能力 3

保留来源站点、仓库和原始说明,方便继续核验

能力 4

展示第三方安全扫描或审计结果

安装后应在对应宿主中按原始 README 的触发条件使用;具体调用方式请以来源页面和 README 为准。

平台分布

Codex

32.99%
按下载量换算75

Claude

30.4%
按下载量换算69

Cursor

17.85%
按下载量换算40

Gemini CLI

9.38%
按下载量换算21

安全审计

Gen Agent Trust Hub

通过

Socket

通过

Snyk

通过

权限和风险

只读

该 Skill 主要提供规则、说明或参考内容,本身偏只读;真正读写文件、联网或执行命令仍取决于宿主 Agent 的任务。

安装前确认

本站仅展示第三方公开信息,不托管安装包,不提供自动安装或运行环境。安装前应自行审查源码、依赖和命令行为。当前只有一个来源,正式发布前建议补源仓库或其他目录站核验。

来源信息

继续浏览同类 Skills