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.
安装与使用
请根据来源仓库和你的 AI 工具说明安装此技能。先阅读技能文件和依赖要求,再添加到工作流。
查看来源 ↗使用指南技能说明
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
-
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
-
Component will be created at:
components/ui/<component-name>.tsx -
Import pattern (follow existing style in
app/page.tsx):import { Button } from '@/components/ui/button'; import { Card, CardContent, CardHeader, CardTitle } from '@/components/ui/card'; -
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-xlorbackdrop-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
使用示例
查看来源仓库中的使用示例与配置说明。
查看来源 ↗来源历史
- 收录时间
- 2026-01-20
- 索引更新时间
- 2026-01-26
- Branch
- main
收录与同步日期属于本站记录。源码修改历史请查看来源仓库。
GitHub ↗chat Comments (0)
Sign in to join the discussion and leave a comment.
No comments yet. Be the first to share your thoughts!