The Situation
A fast-growing SaaS company had accumulated 3 years of design and engineering debt. Five product squads were independently creating UI components, resulting in 14 different button variants, 6 modal implementations, and zero shared conventions.
Audit
We catalogued every unique component across the product surface. The numbers were stark:
| Category | Unique Variants | Consolidated To |
|---|---|---|
| Buttons | 14 | 3 |
| Inputs | 11 | 4 |
| Modals | 6 | 2 |
| Cards | 9 | 3 |
| Typography | 23 styles | 8 scales |
Total CSS payload dropped from 847KB to 124KB after consolidation.
Token Architecture
We built a three-tier token system:
Tier 1 — Primitives
Raw values with no semantic meaning: blue-500, space-16, radius-md. These never appear in component code directly.
Tier 2 — Semantic
Purpose-driven aliases: color-action-primary, space-inline-md, radius-interactive. These are what components consume.
Tier 3 — Component
Scoped overrides for specific contexts: button-padding-x, input-border-color. Used sparingly to handle edge cases.
Component Playground
Below is a live example of a draggable layout widget — one of the interactive primitives we built for the documentation site’s playground:
Interactive Component — Drag the widget
Component API Design
Every component follows strict conventions:
- Composition over configuration — prefer
childrenand slots over boolean props - Polymorphic
asprop — any component can render as any HTML element - Controlled by default — state is always lifted unless explicitly opted out
Version Tracking
We shipped 47 minor versions and 3 major versions in the first year. The counter below demonstrates the kind of interactive documentation element we built to track component usage:
Interactive Component — Brutalist Counter
Adoption
Rather than a “big bang” migration, we introduced the system incrementally:
- Week 1–4: New features must use the system
- Week 5–12: Each sprint includes 2 hours of migration work
- Week 13+: Legacy components sunset as pages are touched
After 6 months, 94% of the product surface used the shared system.
This is a template case study. Replace with your actual project work.