Token导航 LogoToken导航TokenDH.com
研究检索需要联网github未标认证来源可访问clear审计通过

using-shadcn-uiusing shadcn/ui UI 搜索

Agent Skill

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

总安装

539

周安装

22

GitHub Stars

26

下载量

174
CodexClaudeCursorGemini CLI

安装说明

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

GitHub

来源数

3

许可证

MIT

最后核验

2026-05-01

来源状态

来源可访问

安装方式

通过对话安装

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

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

命令行安装

复制命令到本机终端执行。不同来源提供的安装方式可能略有差异;本站展示可直接复制的安装命令,安装前请核对来源页面。

skills.shnpx skills
npx skills add https://github.com/nilecui/skillsbase --skill using-shadcn-ui

简介

用于辅助界面设计、视觉规范和交互体验优化,适合 UI 开发场景。

  • 可帮助整理页面结构、生成 UI 方案或检查视觉一致性表现。
  • 通过 npx skills add 命令从指定 GitHub 仓库安装使用。
  • 使用时需结合现有品牌和设计系统,涉及页面改动时应通过预览检查效果。
  • using-shadcn-ui 属于研究检索类 Skill,可作为该场景下的辅助能力补充。

SKILL.md

Using shadcn/ui

Overview

shadcn/ui is a collection of re-usable, accessible React components built on Radix UI and Tailwind CSS. Unlike traditional component libraries, shadcn/ui copies components directly into your project, giving you full ownership and customization control.

Core principle: Components live in your codebase. You own the code. No package.json dependency.

When to Use

Use shadcn/ui when:

  • Building React applications with Tailwind CSS
  • Need accessible, customizable UI components
  • Want pre-built patterns without library lock-in
  • Implementing common UI patterns (forms, dialogs, dropdowns, etc.)
  • Starting new projects that need design system foundation
  • Need production-ready blocks for hero sections, pricing, testimonials, etc.

shadcnblocks.com integration:

  • 829 blocks across 42 categories
  • Production-ready sections (Hero, Navbar, Footer, Pricing, Testimonials, etc.)
  • Copy-paste directly into your project
  • Built with same shadcn/ui primitives

Don't use for:

  • Non-React projects
  • Projects without Tailwind CSS
  • When you need a locked, versioned component library
  • Simple HTML/CSS projects

Installation Workflow

1. Initialize shadcn/ui

npx shadcn@latest init

Configuration prompts:

  • Style: Default or New York
  • Color: Slate, Gray, Zinc, etc.
  • CSS variables: Yes (recommended)
  • Tailwind config: Use CSS variables for colors

2. Add Components

# Add specific components
npx shadcn@latest add button
npx shadcn@latest add dialog
npx shadcn@latest add form

# Add multiple at once
npx shadcn@latest add button card dialog dropdown-menu

Components install to: components/ui/

3. Using shadcnblocks.com

Visit: https://www.shadcnblocks.com/blocks

Workflow:

  1. Browse category (Hero, Pricing, Testimonial, etc.)
  2. Find desired block
  3. Click "Copy Code"
  4. Paste into your component file
  5. Install any missing shadcn/ui dependencies
  6. Customize colors, text, and layout

Component Categories Reference

CategoryCommon Use CasesExample Components
FormsUser input, validationInput, Textarea, Select, Checkbox, Radio Group
OverlaysModals, popoversDialog, Popover, Tooltip, Sheet
NavigationMenus, dropdownsDropdown Menu, Navigation Menu, Tabs
FeedbackUser notificationsAlert, Toast, Progress, Skeleton
Data DisplayTables, cards, badgesTable, Card, Badge, Avatar
LayoutContainers, separatorsSeparator, Aspect Ratio, Scroll Area

shadcnblocks.com Categories (829 blocks)

Layout & Navigation (200 blocks)

  • Hero (162 blocks): Landing page headers with CTAs
  • Navbar (13 blocks): Navigation headers
  • Footer (18 blocks): Page footers
  • Banner (7 blocks): Announcement bars

Content Sections (367 blocks)

  • Feature (266 blocks): Product feature showcases
  • Blog (22 blocks): Blog layouts and cards
  • Gallery (47 blocks): Image galleries
  • Timeline (14 blocks): Event timelines
  • Team (10 blocks): Team member profiles
  • About (10 blocks): About us sections

Business Components (116 blocks)

  • Pricing (35 blocks): Pricing tables and cards
  • Testimonial (28 blocks): Customer testimonials
  • Case Studies (9 blocks): Success stories
  • Integration (16 blocks): Integration showcases
  • Service/Services (21 blocks): Service offerings
  • Stats (17 blocks): Statistics displays

User Engagement (64 blocks)

  • CTA (25 blocks): Call-to-action sections
  • Contact (13 blocks): Contact forms
  • Signup/Login (17 blocks): Authentication forms
  • Waitlist (2 blocks): Email capture
  • Community (7 blocks): Community features

Information Display (82 blocks)

  • FAQ (15 blocks): Frequently asked questions
  • Comparison (10 blocks): Feature comparisons
  • Logos (11 blocks): Logo grids
  • Resources (4 blocks): Resource libraries
  • Download (12 blocks): Download sections
  • Changelog (7 blocks): Update logs
  • Careers (9 blocks): Job listings
  • Compliance (3 blocks): Legal/privacy sections

Quick Start Example

// 1. Add button component
// $ npx shadcn@latest add button

// 2. Import and use
import { Button } from "@/components/ui/button"

export function MyComponent() {
  return (
    <div>
      <Button variant="default">Click me</Button>
      <Button variant="destructive">Delete</Button>
      <Button variant="outline">Cancel</Button>
      <Button variant="ghost">Subtle</Button>
    </div>
  )
}

Form Pattern with shadcn/ui

// Install: npx shadcn@latest add form input button

import { useForm } from "react-hook-form"
import { zodResolver } from "@hookform/resolvers/zod"
import * as 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 address"),
  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: "",
    },
  })

  function onSubmit(values: z.infer<typeof formSchema>) {
    console.log(values)
  }

  return (
    <Form {...form}>
      <form onSubmit={form.handleSubmit(onSubmit)} className="space-y-4">
        <FormField
          control={form.control}
          name="email"
          render={({ field }) => (
            <FormItem>
              <FormLabel>Email</FormLabel>
              <FormControl>
                <Input placeholder="you@example.com" {...field} />
              </FormControl>
              <FormMessage />
            </FormItem>
          )}
        />
        <FormField
          control={form.control}
          name="password"
          render={({ field }) => (
            <FormItem>
              <FormLabel>Password</FormLabel>
              <FormControl>
                <Input type="password" {...field} />
              </FormControl>
              <FormMessage />
            </FormItem>
          )}
        />
        <Button type="submit">Sign In</Button>
      </form>
    </Form>
  )
}

Dialog/Modal Pattern

// Install: npx shadcn@latest add dialog button

import {
  Dialog,
  DialogContent,
  DialogDescription,
  DialogHeader,
  DialogTitle,
  DialogTrigger,
} from "@/components/ui/dialog"
import { Button } from "@/components/ui/button"

export function ConfirmDialog() {
  return (
    <Dialog>
      <DialogTrigger asChild>
        <Button variant="destructive">Delete Account</Button>
      </DialogTrigger>
      <DialogContent>
        <DialogHeader>
          <DialogTitle>Are you absolutely sure?</DialogTitle>
          <DialogDescription>
            This action cannot be undone. This will permanently delete your
            account and remove your data from our servers.
          </DialogDescription>
        </DialogHeader>
        <div className="flex justify-end gap-3">
          <Button variant="outline">Cancel</Button>
          <Button variant="destructive">Delete</Button>
        </div>
      </DialogContent>
    </Dialog>
  )
}

Using Blocks from shadcnblocks.com

Example: Adding a Hero Section

1. Visit: https://www.shadcnblocks.com/blocks 2. Navigate to: Hero category 3. Select a design 4. Click "Copy Code" 5. Create component:

// app/components/hero.tsx
// (Paste copied code from shadcnblocks.com)

import { Button } from "@/components/ui/button"

export function Hero() {
  return (
    <section className="container flex flex-col items-center gap-8 pt-20 pb-12">
      <h1 className="text-6xl font-bold text-center">
        Build amazing products
      </h1>
      <p className="text-xl text-muted-foreground text-center max-w-2xl">
        Get started with production-ready components built with shadcn/ui
      </p>
      <div className="flex gap-4">
        <Button size="lg">Get Started</Button>
        <Button size="lg" variant="outline">Learn More</Button>
      </div>
    </section>
  )
}

6. Install missing components:

npx shadcn@latest add button

7. Import and use:

import { Hero } from "@/components/hero"

export default function Home() {
  return <Hero />
}

Example: Adding a Pricing Section

// Install: npx shadcn@latest add card button badge

import { Button } from "@/components/ui/button"
import {
  Card,
  CardContent,
  CardDescription,
  CardFooter,
  CardHeader,
  CardTitle,
} from "@/components/ui/card"
import { Badge } from "@/components/ui/badge"

export function Pricing() {
  return (
    <section className="container py-20">
      <h2 className="text-4xl font-bold text-center mb-12">
        Simple, transparent pricing
      </h2>
      <div className="grid md:grid-cols-3 gap-8">
        <Card>
          <CardHeader>
            <CardTitle>Starter</CardTitle>
            <CardDescription>Perfect for trying out</CardDescription>
          </CardHeader>
          <CardContent>
            <div className="text-4xl font-bold mb-2">$9</div>
            <p className="text-sm text-muted-foreground">per month</p>
          </CardContent>
          <CardFooter>
            <Button className="w-full">Get Started</Button>
          </CardFooter>
        </Card>

        <Card className="border-primary">
          <CardHeader>
            <Badge className="w-fit mb-2">Most Popular</Badge>
            <CardTitle>Pro</CardTitle>
            <CardDescription>For growing businesses</CardDescription>
          </CardHeader>
          <CardContent>
            <div className="text-4xl font-bold mb-2">$29</div>
            <p className="text-sm text-muted-foreground">per month</p>
          </CardContent>
          <CardFooter>
            <Button className="w-full">Get Started</Button>
          </CardFooter>
        </Card>

        <Card>
          <CardHeader>
            <CardTitle>Enterprise</CardTitle>
            <CardDescription>For large organizations</CardDescription>
          </CardHeader>
          <CardContent>
            <div className="text-4xl font-bold mb-2">Custom</div>
            <p className="text-sm text-muted-foreground">contact us</p>
          </CardContent>
          <CardFooter>
            <Button className="w-full" variant="outline">Contact Sales</Button>
          </CardFooter>
        </Card>
      </div>
    </section>
  )
}

Customization

Theme Colors

Edit app/globals.css or styles/globals.css:

@layer base {
  :root {
    --background: 0 0% 100%;
    --foreground: 222.2 84% 4.9%;
    --primary: 221.2 83.2% 53.3%;
    --primary-foreground: 210 40% 98%;
    /* ... more CSS variables */
  }

  .dark {
    --background: 222.2 84% 4.9%;
    --foreground: 210 40% 98%;
    /* ... dark mode colors */
  }
}

Component Variants

Components use class-variance-authority for variants:

import { Button } from "@/components/ui/button"

// Available variants:
<Button variant="default">Default</Button>
<Button variant="destructive">Destructive</Button>
<Button variant="outline">Outline</Button>
<Button variant="secondary">Secondary</Button>
<Button variant="ghost">Ghost</Button>
<Button variant="link">Link</Button>

// Available sizes:
<Button size="default">Default</Button>
<Button size="sm">Small</Button>
<Button size="lg">Large</Button>
<Button size="icon">Icon</Button>

Extending Components

Edit the component file directly in components/ui/:

// components/ui/button.tsx
const buttonVariants = cva(
  "inline-flex items-center justify-center...",
  {
    variants: {
      variant: {
        default: "bg-primary text-primary-foreground...",
        destructive: "bg-destructive text-destructive-foreground...",
        // Add custom variant:
        success: "bg-green-600 text-white hover:bg-green-700",
      },
      // ... rest of variants
    }
  }
)

Common Patterns

Loading States

import { Button } from "@/components/ui/button"
import { Loader2 } from "lucide-react"

export function LoadingButton() {
  const [isLoading, setIsLoading] = useState(false)

  return (
    <Button disabled={isLoading}>
      {isLoading && <Loader2 className="mr-2 h-4 w-4 animate-spin" />}
      {isLoading ? "Loading..." : "Submit"}
    </Button>
  )
}

Toast Notifications

// Install: npx shadcn@latest add toast

import { useToast } from "@/hooks/use-toast"
import { Button } from "@/components/ui/button"

export function ToastExample() {
  const { toast } = useToast()

  return (
    <Button
      onClick={() => {
        toast({
          title: "Success!",
          description: "Your changes have been saved.",
        })
      }}
    >
      Show Toast
    </Button>
  )
}

Data Tables

// Install: npx shadcn@latest add table

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

const invoices = [
  { invoice: "INV001", status: "Paid", amount: "$250.00" },
  { invoice: "INV002", status: "Pending", amount: "$150.00" },
]

export function InvoiceTable() {
  return (
    <Table>
      <TableHeader>
        <TableRow>
          <TableHead>Invoice</TableHead>
          <TableHead>Status</TableHead>
          <TableHead>Amount</TableHead>
        </TableRow>
      </TableHeader>
      <TableBody>
        {invoices.map((invoice) => (
          <TableRow key={invoice.invoice}>
            <TableCell>{invoice.invoice}</TableCell>
            <TableCell>{invoice.status}</TableCell>
            <TableCell>{invoice.amount}</TableCell>
          </TableRow>
        ))}
      </TableBody>
    </Table>
  )
}

Common Mistakes

MistakeFix
Installing as npm packageshadcn/ui copies code. Run npx shadcn@latest add [component]
Importing from shadcnImport from @/components/ui/[component]
Not installing dependenciesEach component may need additional packages (listed in CLI)
Modifying in node_modulesComponents live in your components/ui/ - edit directly
Forgetting Tailwind configRun npx shadcn@latest init to configure properly
Skipping shadcnblocks.comDon't build common sections from scratch - use 829 ready blocks

Workflow Summary

Starting new project:

  1. npx shadcn@latest init
  2. Add needed components: npx shadcn@latest add button card dialog
  3. Browse shadcnblocks.com for section blocks
  4. Copy blocks, install dependencies, customize

Adding new feature:

  1. Identify needed components (form, dialog, etc.)
  2. npx shadcn@latest add [components]
  3. Check shadcnblocks.com for similar patterns
  4. Build or adapt from block
  5. Customize colors and content

Customizing:

  1. Edit component files in components/ui/ directly
  2. Modify globals.css for theme colors
  3. Add variants using class-variance-authority patterns

Resources

Integration with Other Tools

Works seamlessly with:

  • Next.js (App Router or Pages)
  • Remix
  • Astro
  • Vite + React
  • React Hook Form
  • Zod validation
  • Tailwind CSS
  • Radix UI (under the hood)

适合场景

01

用户想查找某类 Agent Skill 时

02

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

03

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

04

需要参考平台分布和安装热度时

能力概览

能力 1

按任务关键词查找相关 Skills

能力 2

展示可复制的安装命令

能力 3

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

能力 4

补充不同宿主或平台的使用分布数据

能力 5

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

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

平台分布

Claude Code

26.76%
按下载量换算47

Antigravity

21.36%
按下载量换算37

windsurf

20.08%
按下载量换算35

trae

13%
按下载量换算23

OpenCode

7.59%
按下载量换算13

Gemini CLI

3.1%
按下载量换算5

安全审计

Gen Agent Trust Hub

通过

Socket

通过

Snyk

通过

权限和风险

需要联网

该 Skill 可能需要联网访问来源站点、仓库或外部 API;具体网络访问范围需要结合源码和 README 复核。

安装前确认

本站仅展示第三方公开信息,不托管安装包,不提供自动安装或运行环境。安装前应自行审查源码、依赖和命令行为。

来源信息

继续浏览同类 Skills