Practice Hub /
Core InfrastructureMedium~35 min interview roundStripeRazorpayAirbnb

Design System & Multi-Brand Component Library (Design Tokens & Primitives)

Architect a zero-runtime-overhead, WCAG 2.1 AA compliant component library supporting multi-brand theming via CSS tokens, headless behavior primitives, and tree-shaking.

1. Interactive System Architecture Diagram

Click any architecture component below to inspect its exact responsibilities and trace connected data flows.

CSS Variables Themed Skin Tree-Shakable ESM A11y & Size CI Headless Primitives ARIA + Keyboard Behavior 3-Tier Design Tokens Primitive -> Semantic -> Comp ESM Packaging Tree-Shaking & Subpaths Docs & Visual CI Storybook + Play Tests Token Distribution NPM + SemVer Changelog
Selected ComponentHeadless Primitives — ARIA + Keyboard Behavior
  • Encapsulates tricky focus-trapping, Escape close, Roving Tabindex & ARIA state once.
  • Keeps behavior cleanly separated from visual CSS styling so brands can skin freely.
  • Ships zero inline layout hacks — respects consumer class overrides cleanly.

2. Interactive Trade-Off Simulator

Toggle between real architectural options to compare Pros, Cons, and exactly when to pick each choice in interviews.

Styling Architecture

Which styling approach delivers multi-brand theming with best runtime speed?

Pros

  • Zero runtime JS style injection -> instant SSR hydration & top INP performance.
  • Swapping `[data-theme="brandB"]` updates all components at CSS engine speed.

Cons & Pitfalls

  • Requires clear token naming discipline across teams.
Interview Rule of Thumb: Pick CSS Variables + Tailwind/CSS Layers for multi-brand design systems.
Component API Design

Should `<Modal>` take 25 boolean props or expose composable child primitives?

Pros

  • Avoids prop explosion (`showFooter`, `customCloseIcon`, `headerAlign`) cleanly.
  • Consumers rearrange slots freely while inheriting automatic ARIA wiring via context.

Cons & Pitfalls

  • Slightly more JSX/HTML lines for simple one-off confirmations.
Interview Rule of Thumb: Pick Compound Primitives for Dialogs, Dropdowns, Tabs & Tables.

3. RADIO Framework Breakdown & Interview Checklist

Review each RADIO pillar cleanly and check off sections as you master them.

0 / 5 Sections Reviewed
R

Requirements & Scope

  • Functional: 25+ core UI components, Dark/Light + multi-brand themes, RTL & i18n support.
  • Non-Functional: WCAG 2.1 AA compliant, < 3KB per core atom, zero breaking API churn.
A

Architecture Components

  • 3 Layers: Design Tokens -> Headless Behavior Primitives -> Branded Styled Adapters.
  • Composable slot/compound pattern keeps ARIA bindings intact without prop bloat.
D

Token & Theme Model

  • `TokenSchema: { primitive: Palette, semantic: SurfaceTextPairs, component: Overrides }`
  • Controlled vs Uncontrolled dual API (`value` + `defaultValue`) lets forms integrate effortlessly.
I

Distribution & Packaging

  • `package.json` sets `"sideEffects": false`, ESM exports map, and TypeScript `.d.ts` declarations.
  • Automated Figma-to-NPM pipeline emits CSS custom properties directly.
O

Performance & Quality Gates

  • CI runs `axe-core` keyboard/contrast checks, Playwright visual snapshots, and `size-limit`.
  • Lazy-load heavy portals (Rich Text, DatePicker) cleanly outside initial app chunk.