Standards for Building Scalable, Consistent Component Libraries
Components are organized in three levels of complexity, inspired by atomic design principles:
Basic building blocks
Combinations of atoms
Complex components
Atoms used: Image, Heading, Paragraph, Button, Icon
Classification: Molecule (combines multiple atoms)
Can be used in: Organism (e.g., Product Grid contains multiple Cards)
Every component is broken down into its structural parts.
## Anatomy
**Parts:**
1. **Container** - The button's outer wrapper
2. **Icon** (optional) - Leading or trailing icon
3. **Label** - The button text
4. **Loading Indicator** (optional) - Replaces icon during loading state
Slots define where content goes, not what the content is.
[description slot]
Structure (shared)
Unlock all features
Content (page-specific)
## Slots
1. **image** - Visual content (photo, illustration, icon)
2. **title** - Main heading
3. **description** - Supporting text
4. **action** - Call-to-action button
Props control how a component looks and behaves.
| Prop | Type | Options | Default |
|---|---|---|---|
variant |
string | primary | secondary | ghost | primary |
size |
string | small | medium | large | medium |
disabled |
boolean | true | false | false |
fullWidth |
boolean | true | false | false |
## Props
| Prop | Type | Options | Default | Description |
|------|------|---------|---------|-------------|
| variant | string | primary, secondary, ghost | primary | Visual style |
| size | string | small, medium, large | medium | Button size |
| disabled | boolean | true, false | false | Disable interactions |
| fullWidth | boolean | true, false | false | Stretch to container width |
States define how components respond to user interaction.
Default - Idle state
Hover - Mouse over
Disabled - Not interactive
Loading - Processing
default - Idle/resting statehover - Mouse/pointer over componentactive - Currently pressed/clickedfocus - Keyboard focus (accessibility)disabled - Not interactiveloading - Awaiting responseerror - Invalid/failed statesuccess - Completed successfullyVariants are different visual styles of the same component structure.
Primary - Main actions
Secondary - Less emphasis
Ghost - Minimal style
Same structure, different appearance
Different structure = Different component
Precise measurements for implementation.
| Property | Small | Medium | Large |
|---|---|---|---|
| Height | 32px | 40px | 48px |
| Padding (horizontal) | 12px | 16px | 24px |
| Font Size | 14px | 16px | 18px |
| Border Radius | 4px | 6px | 8px |
| Icon Size | 16px | 20px | 24px |
→ Freya notes it, continues without creating design system entry
→ Freya: "I've used 'Button' twice now. Should I document this in the design system?"
→ User: "Yes"
→ Freya creates E-Design-System/atoms/button/ with full documentation
→ Button: Already documented, reference existing spec
→ Card: Second occurrence → Ask to document
→ Freya: "New variant detected! I'll add 'Ghost' to the Button variants."
→ Updates E-Design-System/atoms/button/05-variants.md
❌ Problem with "first occurrence": You document something that never gets reused.
✅ Solution with "second occurrence": You only document actual patterns.
Components earn their place in the design system by being actually reused, not by being potentially reusable.
Component Usage Tracking:
Button:
- Page 1.1 (first occurrence)
- Page 1.2 (second occurrence) ← TRIGGER: Create design system entry
- Page 1.3 (third occurrence) ← Reference existing
Card:
- Page 1.2 (first occurrence)
- Page 1.3 (second occurrence) ← TRIGGER: Create design system entry
Input:
- Page 2.1 (first occurrence)
[No second occurrence yet, no design system entry]