building-components
bởi vercel
Hướng dẫn toàn diện để xây dựng các thành phần UI hiện đại, dễ tiếp cận và có thể kết hợp. Bao gồm phân loại thành phần (nguyên thủy, thành phần, khối, mẫu), các nguyên tắc thiết kế cốt lõi và triển khai khả năng tiếp cận bao gồm ARIA, điều hướng bàn phím và tuân thủ WCAG. Cung cấp các mẫu cho API có thể kết hợp, đa hình, trạng thái có kiểm soát/không kiểm soát và mẫu as-child để linh hoạt trong việc kết hợp phần tử. Cung cấp hướng dẫn về token thiết kế, hệ thống chủ đề, phương pháp tạo kiểu và sử dụng...
npx skills add https://github.com/vercel/components.build --skill building-componentsBuilding 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
- definitions.mdx - Artifact taxonomy (primitives, components, blocks, templates)
- principles.mdx - Core principles for component design
- accessibility.mdx - ARIA, keyboard navigation, WCAG compliance
- composition.mdx - Composable component patterns
- as-child.mdx - The as-child pattern for element polymorphism
- polymorphism.mdx - Polymorphic component patterns
- types.mdx - TypeScript typing patterns for components
- state.mdx - Controlled vs uncontrolled state management
- data-attributes.mdx - Using data attributes for styling and state
- design-tokens.mdx - Design token systems and theming
- styling.mdx - Component styling approaches
- registry.mdx - shadcn-style registry distribution
- npm.mdx - Publishing components to npm
- marketplaces.mdx - Component marketplace distribution
- docs.mdx - Writing component documentation