Component Design Checklist
When to use: Building new UI components. Reviewing component architecture.
The test: Can this component be used in isolation? Can it be understood in under 30 seconds?
Component Creation Checklist
Run this for every new component:
- Named component - No anonymous exports
- TypeScript interface - Props defined with types
- Semantic HTML - article, section, button - not div soup
- Design tokens - No arbitrary values (use theme)
- Destructured props - With default values
- Single responsibility - Does one thing well
- Independently testable - Works in isolation
Component Types
| Type | Purpose | Data Source | Location |
|---|---|---|---|
| Presentational | Display UI | Props only | Reusable library |
| Structural | Compose layout | Props, maps data | Pages/views |
| Stateful | Manage state | API, context | App-specific |
Rule of Thumb
- Bottom of tree → Presentational (most reusable)
- Middle of tree → Structural (compose others)
- Top of tree → Stateful (app-specific)