component-library
Installation
SKILL.md
component-library
Core Philosophy
A component library is not a random collection of buttons and modal components copied from tutorial repositories. A production component library is an ironclad, scalable UI contract between design and frontend engineering. Components must be structured with consistent anatomy, strict state matrices, accessible keyboard interactions, composable primitives, and 1:1 prop parity between Figma design components and React/Vue/Svelte code.
4-Step Component Library Architecture
Step 1: Component Anatomy & Structural Hierarchy
- Deconstruct the Component Anatomy:
- Every complex component is composed of standard anatomical slots:
- Container / Wrapper: Handles padding, surface background, border, and elevation.
- Leading Element: Icon, avatar, or status badge.
- Content Area: Label, description, children elements.
- Trailing Element: Chevron, counter badge, action icon, or shortcut tag.
- Every complex component is composed of standard anatomical slots: