System Design

Design a Component Library / Design System

hardarchitecture

Design a Component Library / Design System

Interview Prep mode active

Interview answer templates and key talking points. Switch the mode in the header to change your experience.

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

Key Takeaways

  • A design system is a 'Product for Engineers'—it requires a roadmap, support, and documentation.
  • Tokens are the 'Source of Truth'—never hardcode values; always refer back to the token system.
  • Use the 'Atomic Design' methodology to build complexity from simple, reusable primitives.
  • Headless components (like Radix UI) provide the best balance of accessibility and flexibility.
  • Automate visual regression testing (Chromatic/Loki) to catch UI breaks in CI before they reach NPM.
  • Document components with 'Playgrounds' and clear Dos/Don'ts to reduce implementation errors.