ui-components by yonatangross/orchestkit
npx skills add https://github.com/yonatangross/orchestkit --skill ui-components使用 shadcn/ui 和 Radix Primitives 构建无障碍 UI 组件库的综合模式。涵盖 CVA 变体、OKLCH 主题、cn() 工具函数、组件扩展、asChild 组合、对话框/菜单模式以及数据属性样式。每个类别在 rules/ 目录下都有独立的规则文件,按需加载。
| 类别 | 规则数量 | 影响程度 | 使用场景 |
|---|---|---|---|
| shadcn/ui | 3 | 高 | CVA 变体、组件定制、表单模式、数据表格 |
| Radix Primitives | 3 | 高 | 对话框、多态组合、数据属性样式 |
| 设计系统 | 5 | 高 | W3C 令牌、OKLCH 主题、间距比例、排版、组件状态、动画 |
| 设计系统组件 | 1 | 高 | 原子设计、CVA 变体、无障碍性、Storybook |
| 表单 | 2 | 高 | React Hook Form v7、Zod 验证、服务器操作 |
广告位招租
在这里展示您的产品或服务
触达数万 AI 开发者,精准高效
| 现代 CSS 与工具 | 3 | 高 | CSS 级联层、Tailwind v4、Storybook CSF3 |
| UX 基础 | 4 | 高 | 视觉层次、排版阈值、色彩系统、空状态 |
总计:7 个类别,共 21 条规则
// 使用 cn() 工具函数的 CVA 变体系统
import { cva, type VariantProps } from 'class-variance-authority'
import { cn } from '@/lib/utils'
const buttonVariants = cva(
'inline-flex items-center justify-center rounded-md font-medium transition-colors',
{
variants: {
variant: {
default: 'bg-primary text-primary-foreground hover:bg-primary/90',
destructive: 'bg-destructive text-destructive-foreground',
outline: 'border border-input bg-background hover:bg-accent',
ghost: 'hover:bg-accent hover:text-accent-foreground',
},
size: {
default: 'h-10 px-4 py-2',
sm: 'h-9 px-3',
lg: 'h-11 px-8',
},
},
defaultVariants: { variant: 'default', size: 'default' },
}
)
// 使用 asChild 组合的 Radix 对话框
import { Dialog } from 'radix-ui'
<Dialog.Root>
<Dialog.Trigger asChild>
<Button>打开</Button>
</Dialog.Trigger>
<Dialog.Portal>
<Dialog.Overlay className="fixed inset-0 bg-black/50" />
<Dialog.Content className="data-[state=open]:animate-in">
<Dialog.Title>标题</Dialog.Title>
<Dialog.Description>描述</Dialog.Description>
<Dialog.Close>关闭</Dialog.Close>
</Dialog.Content>
</Dialog.Portal>
</Dialog.Root>
基于 CVA 变体、cn() 工具函数和 OKLCH 主题构建的、设计精美且无障碍的组件。
| 规则 | 文件 | 关键模式 |
|---|---|---|
| 定制化 | rules/shadcn-customization.md | CVA 变体、cn() 工具函数、OKLCH 主题、组件扩展 |
| 表单 | rules/shadcn-forms.md | 表单字段包装器、react-hook-form 集成、验证 |
| 数据表格 | rules/shadcn-data-table.md | TanStack Table 集成、列定义、排序/过滤 |
用于构建高质量设计系统的、无样式且无障碍的 React 基础组件。
| 规则 | 文件 | 关键模式 |
|---|---|---|
| 对话框 | rules/radix-dialog.md | Dialog、AlertDialog、受控状态、动画 |
| 组合 | rules/radix-composition.md | asChild、Slot、嵌套触发器、多态渲染 |
| 样式 | rules/radix-styling.md | 数据属性、Tailwind 任意变体、焦点管理 |
| 决策 | 建议 |
|---|---|
| 颜色格式 | 使用 OKLCH 实现感知均匀的主题 |
| 类合并 | 始终使用 cn() 处理 Tailwind 类冲突 |
| 扩展组件 | 包装组件,而非修改源文件 |
| 变体 | 使用 CVA 实现类型安全的多轴变体 |
| 样式方法 | 数据属性 + Tailwind 任意变体 |
| 组合 | 使用 asChild 避免包装 div |
| 动画 | 仅使用 CSS 配合 data-state 选择器 |
| 表单组件 | 与 react-hook-form 结合使用 |
asChild 避免额外的 DOM 元素tabindex > 0 会破坏自然的 Tab 键顺序| 资源 | 描述 |
|---|---|
| scripts/ | 模板:CVA 组件、扩展按钮、对话框、下拉菜单 |
| checklists/ | shadcn 设置、无障碍审计清单 |
| references/ | CVA 系统、OKLCH 主题、cn() 工具函数、焦点管理 |
设计令牌架构、间距、排版以及交互式组件状态。
| 规则 | 文件 | 关键模式 |
|---|---|---|
| 令牌架构 | rules/design-system-tokens.md | W3C 令牌、OKLCH 颜色、Tailwind @theme |
| 间距比例 | rules/design-system-spacing.md | 8px 网格、Tailwind space-1 到 space-12 |
| 排版比例 | rules/design-system-typography.md | 字体大小、字重、行高 |
| 组件状态 | rules/design-system-states.md | 悬停、焦点、激活、禁用、加载、动画预设 |
采用原子设计和无障碍性的组件架构模式。
| 规则 | 文件 | 关键模式 |
|---|---|---|
| 组件架构 | rules/design-system-components.md | 原子设计、CVA 变体、WCAG 2.1 AA、Storybook |
结合 Zod 验证和 React 19 服务器操作的 React Hook Form v7。
| 规则 | 文件 | 关键模式 |
|---|---|---|
| React Hook Form | rules/forms-react-hook-form.md | useForm、字段数组、Controller、向导、文件上传 |
| Zod 与服务器操作 | rules/forms-validation-zod.md | Zod 模式、服务器操作、useActionState、异步验证 |
面向 2026 年的现代 CSS 模式、Tailwind v4 和组件文档工具。
| 规则 | 文件 | 关键模式 |
|---|---|---|
| CSS 级联层 | rules/css-cascade-layers.md | @layer 排序、无特异性覆盖、第三方隔离 |
| Tailwind v4 | rules/tailwind-v4-patterns.md | CSS 优先的 @theme、原生容器查询、@max-* 变体 |
| Storybook 文档 | rules/storybook-component-docs.md | CSF3 故事、play() 交互测试、Chromatic 视觉回归 |
基于认知科学的 UI/UX 原则,为生产级界面提供具体的数值阈值。
| 规则 | 文件 | 关键模式 |
|---|---|---|
| 视觉层次 | rules/visual-hierarchy.md | 按钮层级、弱化、F/Z 扫描、冯·雷斯托夫效应、邻近性、最大宽度 |
| 排版阈值 | rules/typography-thresholds.md | 65ch 行长、1.4–1.6 行高、rem 单位、模块化字体比例 |
| 色彩系统 | rules/color-system.md | OKLCH 9 色阶、语义类别、无纯黑色、品牌色调中性色 |
| 空状态 | rules/empty-states.md | 骨架屏优先、图标 + 标题 + 描述 + 行动号召、原因特定语气 |
ork:accessibility - WCAG 合规性与 React Aria 模式ork:testing-unit - 组件测试模式每周安装量
236
代码仓库
GitHub 星标数
132
首次出现
2026年2月13日
安全审计
安装于
opencode222
codex211
gemini-cli207
cursor202
github-copilot195
claude-code194
Comprehensive patterns for building accessible UI component libraries with shadcn/ui and Radix Primitives. Covers CVA variants, OKLCH theming, cn() utility, component extension, asChild composition, dialog/menu patterns, and data-attribute styling. Each category has individual rule files in rules/ loaded on-demand.
| Category | Rules | Impact | When to Use |
|---|---|---|---|
| shadcn/ui | 3 | HIGH | CVA variants, component customization, form patterns, data tables |
| Radix Primitives | 3 | HIGH | Dialogs, polymorphic composition, data-attribute styling |
| Design System | 5 | HIGH | W3C tokens, OKLCH theming, spacing scales, typography, component states, animation |
| Design System Components | 1 | HIGH | Atomic design, CVA variants, accessibility, Storybook |
| Forms | 2 | HIGH | React Hook Form v7, Zod validation, Server Actions |
| Modern CSS & Tooling | 3 | HIGH | CSS cascade layers, Tailwind v4, Storybook CSF3 |
| UX Foundations | 4 | HIGH | Visual hierarchy, typography thresholds, color system, empty states |
Total: 21 rules across 7 categories
// CVA variant system with cn() utility
import { cva, type VariantProps } from 'class-variance-authority'
import { cn } from '@/lib/utils'
const buttonVariants = cva(
'inline-flex items-center justify-center rounded-md font-medium transition-colors',
{
variants: {
variant: {
default: 'bg-primary text-primary-foreground hover:bg-primary/90',
destructive: 'bg-destructive text-destructive-foreground',
outline: 'border border-input bg-background hover:bg-accent',
ghost: 'hover:bg-accent hover:text-accent-foreground',
},
size: {
default: 'h-10 px-4 py-2',
sm: 'h-9 px-3',
lg: 'h-11 px-8',
},
},
defaultVariants: { variant: 'default', size: 'default' },
}
)
// Radix Dialog with asChild composition
import { Dialog } from 'radix-ui'
<Dialog.Root>
<Dialog.Trigger asChild>
<Button>Open</Button>
</Dialog.Trigger>
<Dialog.Portal>
<Dialog.Overlay className="fixed inset-0 bg-black/50" />
<Dialog.Content className="data-[state=open]:animate-in">
<Dialog.Title>Title</Dialog.Title>
<Dialog.Description>Description</Dialog.Description>
<Dialog.Close>Close</Dialog.Close>
</Dialog.Content>
</Dialog.Portal>
</Dialog.Root>
Beautifully designed, accessible components built on CVA variants, cn() utility, and OKLCH theming.
| Rule | File | Key Pattern |
|---|---|---|
| Customization | rules/shadcn-customization.md | CVA variants, cn() utility, OKLCH theming, component extension |
| Forms | rules/shadcn-forms.md | Form field wrappers, react-hook-form integration, validation |
| Data Table | rules/shadcn-data-table.md | TanStack Table integration, column definitions, sorting/filtering |
Unstyled, accessible React primitives for building high-quality design systems.
| Rule | File | Key Pattern |
|---|---|---|
| Dialog | rules/radix-dialog.md | Dialog, AlertDialog, controlled state, animations |
| Composition | rules/radix-composition.md | asChild, Slot, nested triggers, polymorphic rendering |
| Styling | rules/radix-styling.md | Data attributes, Tailwind arbitrary variants, focus management |
| Decision | Recommendation |
|---|---|
| Color format | OKLCH for perceptually uniform theming |
| Class merging | Always use cn() for Tailwind conflicts |
| Extending components | Wrap, don't modify source files |
| Variants | Use CVA for type-safe multi-axis variants |
| Styling approach | Data attributes + Tailwind arbitrary variants |
| Composition | Use asChild to avoid wrapper divs |
| Animation | CSS-only with data-state selectors |
| Form components | Combine with react-hook-form |
asChild to avoid extra DOM elementstabindex > 0 disrupts natural tab order| Resource | Description |
|---|---|
| scripts/ | Templates: CVA component, extended button, dialog, dropdown |
| checklists/ | shadcn setup, accessibility audit checklists |
| references/ | CVA system, OKLCH theming, cn() utility, focus management |
Design token architecture, spacing, typography, and interactive component states.
| Rule | File | Key Pattern |
|---|---|---|
| Token Architecture | rules/design-system-tokens.md | W3C tokens, OKLCH colors, Tailwind @theme |
| Spacing Scale | rules/design-system-spacing.md | 8px grid, Tailwind space-1 to space-12 |
| Typography Scale | rules/design-system-typography.md | Font sizes, weights, line heights |
| Component States | rules/design-system-states.md | Hover, focus, active, disabled, loading, animation presets |
Component architecture patterns with atomic design and accessibility.
| Rule | File | Key Pattern |
|---|---|---|
| Component Architecture | rules/design-system-components.md | Atomic design, CVA variants, WCAG 2.1 AA, Storybook |
React Hook Form v7 with Zod validation and React 19 Server Actions.
| Rule | File | Key Pattern |
|---|---|---|
| React Hook Form | rules/forms-react-hook-form.md | useForm, field arrays, Controller, wizards, file uploads |
| Zod & Server Actions | rules/forms-validation-zod.md | Zod schemas, Server Actions, useActionState, async validation |
Modern CSS patterns, Tailwind v4, and component documentation tooling for 2026.
| Rule | File | Key Pattern |
|---|---|---|
| CSS Cascade Layers | rules/css-cascade-layers.md | @layer ordering, specificity-free overrides, third-party isolation |
| Tailwind v4 | rules/tailwind-v4-patterns.md | CSS-first @theme, native container queries, @max-* variants |
| Storybook Docs | rules/storybook-component-docs.md | CSF3 stories, play() interaction tests, Chromatic visual regression |
Cognitive-science-grounded UI/UX principles with specific numeric thresholds for production-quality interfaces.
| Rule | File | Key Pattern |
|---|---|---|
| Visual Hierarchy | rules/visual-hierarchy.md | Button tiers, de-emphasis, F/Z scan, Von Restorff, proximity, max-width |
| Typography Thresholds | rules/typography-thresholds.md | 65ch line length, 1.4–1.6 line height, rem units, modular type scale |
| Color System | rules/color-system.md | OKLCH 9-shade scales, semantic categories, no true black, brand-tinted neutrals |
| Empty States | rules/empty-states.md | Skeleton-first, icon + headline + description + CTA, cause-specific tone |
ork:accessibility - WCAG compliance and React Aria patternsork:testing-unit - Component testing patternsWeekly Installs
236
Repository
GitHub Stars
132
First Seen
Feb 13, 2026
Security Audits
Gen Agent Trust HubPassSocketPassSnykPass
Installed on
opencode222
codex211
gemini-cli207
cursor202
github-copilot195
claude-code194
竞争对手研究指南:SEO、内容、反向链接与定价分析工具
231 周安装
Azure 工作负载自动升级评估工具 - 支持 Functions、App Service 计划与 SKU 迁移
231 周安装
Kaizen持续改进方法论:软件开发中的渐进式优化与防错设计实践指南
231 周安装
软件UI/UX设计指南:以用户为中心的设计原则、WCAG可访问性与平台规范
231 周安装
Apify 网络爬虫和自动化平台 - 无需编码抓取亚马逊、谷歌、领英等网站数据
231 周安装
llama.cpp 中文指南:纯 C/C++ LLM 推理,CPU/非 NVIDIA 硬件优化部署
231 周安装