building-components

作者: vercel

构建现代、可访问且可组合的UI组件的全面指南。涵盖组件分类(原语、组件、区块、模板)、核心设计原则以及可访问性实现,包括ARIA、键盘导航和WCAG合规性。包含可组合API、多态性、受控/非受控状态以及用于灵活元素组合的as-child模式等模式。提供关于设计令牌、主题系统、样式方法以及使用...的指导。

npx skills add https://github.com/vercel/components.build --skill building-components

Building Components

When to use this skill

Use when the user is:

  • Building new UI components (primitives, components, blocks, templates)
  • Implementing accessibility features (ARIA, keyboard navigation, focus management)
  • Creating composable component APIs (slots, render props, controlled/uncontrolled state)
  • Setting up design tokens and theming systems
  • Publishing components to npm or a registry
  • Writing component documentation
  • Implementing polymorphism or as-child patterns
  • Working with data attributes for styling/state

References