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