system design

System Design: Component Library

Design a shared UI component library used by 10 product teams.

System Design: Component Library

The Problem

Design a shared React component library (design system) for a company with 10 product teams and 50 frontend engineers. Components should be consistent, accessible, and easy to adopt.

Architecture

Component library (npm package)
├── Primitives (Button, Input, Card, Modal)
├── Compositions (SearchBar, DataTable, Form)
├── Tokens (colors, spacing, typography)
├── Documentation (Storybook)
└── CI/CD (automated visual regression tests)

Key Decisions

DecisionChoiceWhy
StylingCSS custom properties + utility classesZero runtime cost, themeable
AccessibilityWCAG 2.1 AA built into every componentNot optional — legal requirement in EU
VersioningSemantic versioning with changelogsTeams can upgrade on their schedule
DocumentationStorybook with interactive examplesEngineers learn by playing, not reading
TestingVisual regression (Chromatic) + unit tests (Testing Library)Catch visual bugs before merge
Distributionnpm private registryStandard tooling, tree-shakeable

Adoption Strategy

  • Start with 5 most-used components (Button, Input, Card, Modal, Toast)
  • Migration guide for each component showing before/after
  • Codemods for automated migration
  • Office hours for questions
  • Dashboard tracking adoption % per team
  • Your design notes

    Work through this problem yourself before reading the walkthrough above. Your notes are stored locally and not submitted anywhere — only sent to the AI when you click Review.