Senior & Lead Track · Chapter 4 of 15

Design systems

"Tell me about a design system you built or improved" is one of the most common lead-level prompts, and "Design a component library for multiple products" is a common system design question. Both test whether you see a design system as a product with users (engineers and designers), not just a folder of components.

What a design system contains

LayerContentsOwner
FoundationsDesign tokens: color, typography, spacing, radius, elevation, motionDesign + engineering
PrimitivesButton, Input, Checkbox, Dialog, Menu, Tooltip, PopoverDS team
PatternsForms, data tables, empty states, navigation, notificationsDS team + product teams
GuidelinesUsage, content, accessibility, do/don'tDesign
ToolingFigma library, Storybook docs, lint rules, codemods, templatesDS team
ProcessContribution model, versioning, support, roadmapDS lead

Design tokens

Tokens are the contract between design and code. Use tiers:

{
  "color": {
    "blue": { "600": { "$value": "#2563eb", "$type": "color" } },
    "action": {
      "primary": {
        "bg": { "$value": "{color.blue.600}", "$type": "color" }
      }
    }
  }
}
TierExamplePurpose
Primitive / referenceblue-600Raw palette
Semantic / systemaction-primary-bg, text-muted, surface-raisedMeaning; theme-switchable
Componentbutton-primary-bgOptional; component-level overrides
  • Store tokens in a format based on the W3C Design Tokens Community Group spec (its first stable version was published in 2025) and transform them with Style Dictionary or similar into CSS variables, TS constants, and native platforms.
  • Theming (dark mode, brands, density) means swapping semantic token values. Components only reference semantic tokens.
  • Sync with Figma variables to cut drift.
:root { --color-action-primary-bg: #2563eb; }
[data-theme="dark"] { --color-action-primary-bg: #60a5fa; }
.button-primary { background: var(--color-action-primary-bg); }

Component architecture

Headless core + styled layer

  • Build or adopt headless primitives (React Aria, Radix, Ark UI) for complex widgets: combobox, menu, dialog, date picker. Getting the a11y right is expensive and already solved there.
  • Wrap them in your own API so you can swap the underlying library later.

API design principles

PrincipleExample
Composition over configuration<Card><Card.Header/><Card.Body/></Card> instead of 20 props
Consistent namingsize, variant, tone used identically everywhere
Controlled + uncontrolledvalue/defaultValue/onValueChange
Polymorphism with careasChild or as for semantic flexibility
Accessible by defaultRequired label props, correct roles, focus management built in
Escape hatchesclassName merging, style, slot props, forwarded refs
Typed variantsUnion types (variant: 'primary' | 'secondary' | 'ghost')
type ButtonProps = React.ComponentProps<'button'> & {
  variant?: 'primary' | 'secondary' | 'ghost' | 'danger';
  size?: 'sm' | 'md' | 'lg';
  loading?: boolean;
};

export function Button({ variant = 'primary', size = 'md', loading, disabled, children, className, ...rest }: ButtonProps) {
  return (
    <button
      {...rest}
      className={cx('btn', `btn--${variant}`, `btn--${size}`, className)}
      disabled={disabled || loading}
      aria-busy={loading || undefined}
    >
      {loading ? <Spinner aria-hidden /> : null}
      <span className={loading ? 'visually-hidden' : undefined}>{children}</span>
    </button>
  );
}

Accessibility as a feature of the system

The design system is the biggest a11y lever in an organization: fix it once and every product benefits.

  • WCAG 2.2 AA as the baseline. Document the keyboard and screen reader behavior for each component.
  • Automated checks (axe) in Storybook and CI. Manual screen reader testing (NVDA, JAWS, VoiceOver) on each release of complex components.
  • Color tokens validated for contrast. Focus-visible styles built into tokens.
  • Respect prefers-reduced-motion in motion tokens.

Distribution and versioning

DecisionOptionsGuidance
PackagingOne package vs per-component packagesOne package with tree-shakeable ESM exports is simplest; split only for very large systems
VersioningSemVer with changesetsBreaking changes in majors only; publish a migration guide + codemod
Release cadenceContinuous vs scheduledContinuous patch/minor; majors at most 1–2 per year
DeprecationWarnings, lint rules, codemodsDeprecate → warn in dev → lint error → remove in next major
Source distributionCopy-in (shadcn/ui-style) vs installed packageCopy-in gives teams full control but loses central upgrades; installed packages keep consistency

Measure upgrade lag: the percentage of apps on the latest major. If it's low, your upgrade cost is too high.

Governance and contribution

ModelDescriptionWorks when
CentralizedDS team builds everythingSmall org, early system
FederatedProduct teams contribute with DS reviewLarger org, mature system
HybridDS owns primitives; product teams own patterns with DS standardsMost mid-to-large orgs

Contribution process:

  1. Proposal (issue/RFC) with use cases from at least two teams.
  2. Design review (Figma) and API review.
  3. Build with docs, tests, a11y checks, and visual regression baselines.
  4. Release with a changelog and announcement.

Adoption: the real measure of success

A design system nobody uses is a cost center. Track:

MetricHow
Coverage% of UI components in product code that come from the DS (static analysis of imports; tools like Omlet or custom scripts)
Detachment rateFigma instances detached from library components
Version currency% of apps on latest major/minor
Time to build a new screenSurvey or task timing
A11y defectsBugs in DS components vs custom components
SatisfactionQuarterly survey (NPS-style) of engineers and designers
Support loadQuestions per week, time to answer

Drive adoption through pull, not push: make the DS the easiest path. Good docs, fast fixes, templates, codemods, and office hours. Lint rules that flag raw <button> usage nudge without blocking.

Common pitfalls

  • Building for imagined use cases instead of extracting proven patterns.
  • Too rigid: no escape hatches, so teams fork.
  • Too flexible: 40 props, inconsistent outcomes.
  • No dedicated ownership: a side project gets abandoned after the first push.
  • Ignoring designers: Figma and code drift apart.
  • Big-bang migrations: forcing every team to adopt at once.

A sample RFC outline: "Unified design system v2"

  1. Problem: three diverging component libraries; 18% of UI bugs are inconsistencies; dark mode impossible.
  2. Goals / non-goals: semantic tokens and theming, accessible primitives; not redesigning brand visuals.
  3. Proposal: token pipeline, headless core (React Aria), styled layer with CSS variables, Storybook docs.
  4. Alternatives: adopt MUI/Chakra wholesale; keep libraries and share tokens only.
  5. Migration: codemods for Button/Input; per-team adoption plan; legacy wrappers.
  6. Operating model: a team of 3 engineers + 1 designer; hybrid contribution.
  7. Metrics: coverage from 40% to 80% in 12 months; a11y bugs −50%; upgrade lag < 1 major.
  8. Risks: adoption stalls → mitigated with exec sponsorship and embedded DS engineers.

Interview story structure

"We had three teams each building their own buttons and modals. I wrote an RFC for a shared system with semantic tokens and headless primitives, got design leadership to co-own it, and staffed a small team. We prioritized the ten components covering 70% of usage, shipped codemods, and embedded one engineer with each product team for a sprint. Coverage went from 30% to 85% in three quarters, dark mode shipped in two weeks instead of an estimated two months, and a11y audit findings fell by 60%."

Spotted a mistake or a rights concern? Report an issue