← System Design

Design a Component Library / Design System

hard
Asked at
Atlassian
Atlassian

Problem statement

Design a scalable internal design system with token layers, accessible primitives, theming, variant APIs, Storybook documentation, and a versioning strategy.

Asked In

Shopify (Polaris)Adobe (Spectrum)Salesforce (Lightning)AtlassianGitHub (Primer)

Key Challenges

  • ·Consistency at Scale: Ensuring a 'Button' looks and behaves the same across 50+ disparate products and teams
  • ·Design-to-Code Sync: Automating the pipeline from Figma design tokens to JSON/CSS variables
  • ·Versioning & Migration: Managing breaking changes without breaking the production builds of consumer apps
  • ·Accessibility (A11y) by Default: Embedding WCAG 2.1 compliance into the lowest level of the component primitive
  • ·Theming & Sub-branding: Supporting multi-brand themes and dark mode with zero-runtime CSS overhead
  • ·Tree-shaking & Performance: Minimizing the bundle footprint of the library in consumer applications
  • ·Documentation & Discovery: Building a Storybook/Documentation site that serves both designers and engineers
★

2-Minute Answer — High-Level TL;DR

Read this before your interview

HLD Interview Focus

I would design the library as a layered product: primitive tokens, semantic tokens, headless or lightly-styled primitives (Button, Input, Dialog), then composite patterns. Accessibility and theming are part of the contract — every interactive component ships keyboard behavior, focus rings, and documented ARIA. ThemeProvider exposes CSS variables for light/dark/density without runtime style thrash. Releases are semver with visual regression CI and codemods for breaking props. Docs examples are the consumer contract. The hard part is governance and adoption across teams — not drawing a Button in isolation.

→

My Approach: Building the Solution

How to think about this problem

I'll start from how a product team consumes the system — install, theme, compose a Dialog — then work backward into tokens, primitives, a11y gates, and the release train.

Why This Approach?

Most candidates dump a Button and Input into Storybook and call it a system. That answer collapses when a product team asks how dark mode ships without forking CSS, how Dialog focus traps are gated in CI, or how a breaking Button API migrates across twenty apps. Strong answers treat the library as a versioned product: tokens, primitives, a11y release gates, and a release train with visual regression.

A design system is a city's building code: bricks (tokens), standard doors (primitives), and floor plans (patterns). Builders can innovate inside the code; they cannot ship a door that traps people (a11y).

R

Requirements: What Makes a Great Solution?

Clarify scope before designing anything

Requirements Exploration Questions

Ask your interviewer these questions to refine requirements

What is the organization's scale?

  • ·Single product team vs 100+ engineers
  • ·Single framework (React) vs Multi-framework requirements
  • ·Global audience (RTL support, Multi-language)

What is the theming requirement?

  • ·Static brand colors vs Dynamic white-labeling
  • ·Dark mode / High contrast support
  • ·Figma-to-Code automation needs

What is the distribution target?

  • ·Internal NPM registry vs Public Open Source
  • ·Bundle size limits for mobile/web
  • ·Legacy browser support (IE11 vs Evergreen)

Functional Requirements

Must Have — MVP

  • ✓Foundation (Tokens): Colors, Typography, Spacing, Shadows
  • ✓Atoms: Button, Input, Checkbox, Icon, Typography
  • ✓Molecules: FormField, Modal, Tooltip, Breadcrumb
  • ✓Documentation site with interactive playground
  • ✓Theming engine (CSS Variables / JS)
  • ✓Built-in Accessibility (ARIA, Keyboard focus)

Advanced (If Time Permits)

  • +Headless UI primitives (Behavior without style)
  • +Layout Grid system (Flex/Grid based)
  • +Visual regression testing (Screenshot diffing)
  • +Automated Token Sync (Figma API integration)
  • +Internationalization (RTL/LTR) support
  • +Skeleton loading state primitives

Non-Functional Requirements

Performance

  • ·Minimal runtime overhead (CSS Variables focus)
  • ·Perfect tree-shaking (ESM distribution)
  • ·Sub-100ms render time for complex forms
  • ·Bundle size monitoring per component

Quality & Reliability

  • ·Unit test coverage > 90%
  • ·Semantic Versioning (SemVer) enforcement
  • ·Visual regression diffing on every PR
  • ·Typescript 'Strict' mode throughout

Developer Experience (DX)

  • ·Storybook with 'Docs' and 'Controls' addons
  • ·CLI for scaffolding new components
  • ·ESLint/Prettier configurations for consumers
Premium

The full solution is part of HelloFrontend Pro

The question above is free to read in full. Upgrade to unlock the interactive workspace and the senior-level walkthrough that go with it.

  • Full RADIO-framework walkthrough with architecture diagrams
  • Data model, API design, and rendering strategy trade-offs
  • Performance, accessibility, and offline sections plus a model answer
Unlock the full solution →

Already a member? Log in to open the workspace.

More System Design questions

View all System Design →