🎨 Unit 13 • UI/UX Design Masterclass

Design Systems & Component Architecture

Engineering a shared visual language at scale: design tokens, semantic color systems, typographic modular scales, 8-point spatial grids, icon ecosystems, production component libraries, systematic naming conventions, responsive reflow, and enterprise governance.

🏷️ Tokens: 3-Tier W3C Token Hierarchy
📐 Grid & Scale: 8-Point Spacing & Modular Type
🧩 Library: Buttons, Form Inputs & Icons
📚 Documentation: Governance, Storybook & Zeroheight
01

What is a Design System?

A Design System is not merely a Figma UI kit or a front-end component repository. It is the comprehensive, single source of truth that unites product design, software engineering, and brand strategy into a unified ecosystem. It encompasses guidelines, reusable UI components, design tokens, code implementations, and governance protocols.

1. UI Kit (Figma)

Static or interactive vector components, variants, and color styles in design software for mocking up user interfaces.

2. Pattern Library

Documented collections of user interface solutions to recurring problems (e.g., checkout flows, modal behavior, search filters).

3. Design System (Full)

The living infrastructure connecting Figma UI kits, coded React/Vue/Swift components, design tokens, accessibility standards, and governance.

1
Tier 1: Global Primitives (Context-Free Raw Tokens)
Direct hex codes, raw pixel values: purple-500 = #8b5cf6, space-8 = 8px, font-inter = 'Inter'.
2
Tier 2: Semantic Intent Tokens (Purpose & Theme Layer)
Abstracting meaning: surface-primary = {purple-500}, text-danger = {red-600}. Enables instant Dark Mode switching!
3
Tier 3: Component-Scoped Tokens (Specific Overrides)
Component anatomy bindings: button-primary-bg = {surface-primary}, input-border = {border-neutral}.
02

Design Tokens, Color Architecture & Typographic Scales

Design tokens represent the atomic sub-elements of a design system stored as platform-agnostic key-value pairs (W3C Design Token Community Group standard):

Color System Architecture
  • Brand / Accent: Primary purple (#8b5cf6) and pink (#ec4899) for interactive focus.
  • Neutrals / Grays: 10-step tonal scale (50 to 900) for surfaces, card backgrounds, and borders.
  • Functional Feedback: Success Green (#10b981), Warning Amber (#f59e0b), and Error Red (#ef4444).
  • WCAG 2.2 Contrast: Guaranteed 4.5:1 text luminosity against all paired background tokens.
Modular Typographic Scale
  • Base Size: 16px body copy (1rem) for optical legibility.
  • Scale Ratio: Major Third (1.250) or Perfect Fourth (1.333) creating mathematical size jumps: 12px, 14px, 16px, 20px, 24px, 32px, 40px.
  • Line-Height Coupling: Body copy (150% / 1.6), Headings (115% / 1.2) to prevent text overlap.
design-tokens-w3c-spec.json
{
  "color": {
    "brand": {
      "primary": { "value": "#8b5cf6", "type": "color" },
      "primary-hover": { "value": "#7c3aed", "type": "color" }
    },
    "semantic": {
      "surface": {
        "canvas": { "value": "#0d0b18", "type": "color" },
        "card":   { "value": "#17112c", "type": "color" }
      },
      "feedback": {
        "success": { "value": "#10b981", "type": "color" },
        "error":   { "value": "#ef4444", "type": "color" }
      }
    }
  },
  "space": {
    "2": { "value": "2px", "type": "dimension" },
    "4": { "value": "4px", "type": "dimension" },
    "8": { "value": "8px", "type": "dimension" },
    "16": { "value": "16px", "type": "dimension" },
    "24": { "value": "24px", "type": "dimension" },
    "32": { "value": "32px", "type": "dimension" }
  }
}
03

The 8-Point Spacing System & Icon Architecture

The 8-Point Grid Standard

Every margin, padding, height, and gap in the interface must be an integer multiple of 8 (or 4 for micro-spacing):

  • Allowed Values: 4px, 8px, 12px, 16px, 24px, 32px, 48px, 64px.
  • Why 8?: All major screen hardware resolutions (1080p, 1440p, 4K, Retina, Android hdpi/xhdpi/xxhdpi) divide cleanly by 8, eliminating fractional sub-pixel blurriness.
Production Icon Library Standards
  • Consistent Bounding Box: All glyphs designed within a square 24×24px or 20×20px frame with a 2px interior padding ring.
  • Optical Centering: Asymmetrical shapes (e.g., play triangle) shifted optically to balance visual centroid.
  • Stroke vs Fill: Distinct variants for outline (inactive navigation) vs solid fill (active state).
  • SVG Optimization: Stripped of hardcoded fills to inherit currentColor (fill: currentColor).
04

Component Libraries, Buttons, Forms & Naming Conventions

In professional enterprise design systems, components follow strict naming taxonomies that bridge the gap between Figma layers and React/Vue props:

Component Variant Axes Allowed Values Engineering Code Equivalent
Button variant, size, state, hasIcon Primary, Secondary, Ghost, Danger | Sm, Md, Lg | Default, Hover, Busy <Button variant="primary" size="md" isLoading />
TextInput status, size, disabled Default, Focus, Error, Success | Md, Lg | True, False <TextInput status="error" helper="Invalid email" />
Badge / Pill tone, format Neutral, Success, Warning, Danger | Soft, Solid, Outlined <Badge tone="success" format="soft">Live</Badge>
Modal size, dismissible Sm (400px), Md (560px), Lg (800px) | True, False <Modal size="md" onClose={handleClose}>
responsive-design-system-component.css
/* Responsive Design System Component using Tokens */
:root {
  --ds-space-sm: 8px;
  --ds-space-md: 16px;
  --ds-radius-card: 12px;
  --ds-color-surface: #17112c;
  --ds-color-border: rgba(255, 255, 255, 0.08);
}

.ds-card-container {
  display: flex;
  flex-direction: column;
  gap: var(--ds-space-md);
  padding: var(--ds-space-md);
  background-color: var(--ds-color-surface);
  border: 1px solid var(--ds-color-border);
  border-radius: var(--ds-radius-card);
  transition: border-color 0.2s ease;
}

/* Fluid Responsive Breakpoint: Mobile to Desktop */
@media (min-width: 768px) {
  .ds-card-container {
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
    padding: calc(var(--ds-space-md) * 1.5);
  }
}
05

Design Consistency, Documentation & Component Maintenance

Enforcing Design Consistency
  • Single Source of Truth: Never allow unlinked detached components or rogue hex codes on production screens.
  • Linter Plugins: Utilizing Figma Linters to flag missing text styles, unattached color fills, or non-8pt padding values.
  • Deprecation Protocols: Mark outdated components with yellow strikethrough badges before removing them in major version increments.
Living Documentation Infrastructure
  • Storybook: Live isolated component testbed where developers verify props, states, and accessibility trees.
  • Zeroheight / Supernova: Cloud documentation portals embedding live Figma frames alongside code snippets.
  • Semantic Versioning (SemVer): MAJOR.MINOR.PATCH (e.g., v2.1.0) governing system releases and breaking changes.
06

Viva Voce & Engineering Interview Questions

Q1 • Concept What is the primary difference between a UI Kit and a complete Design System?
A UI Kit is purely a visual design artifact (a collection of static Figma components and color styles). A Design System is the entire living operational ecosystem encompassing UI kits, coded component repositories (React/iOS/Android), platform-agnostic design tokens, design principles, accessibility guidelines, brand voice documentation, and team governance models.
Q2 • Tokens Why is a 3-tier design token architecture preferred over hardcoded color styles?
A 3-tier architecture (Global > Semantic > Component) decouples raw color values from their functional purpose. By binding components to semantic tokens (e.g., surface-primary referencing purple-500 in light mode and slate-900 in dark mode), entire brand re-themes and light/dark modes can be executed instantaneously across web, iOS, and Android without changing component markup.
Q3 • Grid Mathematics Why does the digital product design industry standardize on the 8-Point Spacing Grid?
The 8-point grid ensures mathematical harmony across diverse screen resolutions. Common modern display widths (360, 375, 390, 768, 1080, 1440, 1920) divide cleanly into multiples of 8 or 4. This avoids fractional sub-pixel rendering (like 0.5px rendering artifacts that blur borders and text) and eliminates endless designer debate over arbitrary spacing values.
Q4 • Engineering Parity How do naming conventions in design systems establish parity between design and engineering?
When Figma component variants use the exact same property names and values as the front-end code (e.g., Figma: variant=primary, size=lg, disabled=false matching React: <Button variant="primary" size="lg" />), cognitive friction is eliminated. Engineers and designers speak the exact same vocabulary during sprint planning, design reviews, and QA testing.
Q5 • Versioning How is Semantic Versioning (SemVer) applied to enterprise design systems?
Design systems follow MAJOR.MINOR.PATCH. A PATCH (v1.0.1) addresses bug fixes or non-breaking contrast updates. A MINOR (v1.1.0) adds backward-compatible new components or props. A MAJOR (v2.0.0) introduces breaking changes—such as renaming core token variables, deprecating a component API, or overhauling global layout architectures.
Q6 • Icons Why must vector icons in a design system be bounded inside a consistent square frame?
A standardized bounding box (such as 24×24px) guarantees that all icons occupy an identical spatial footprint in layout containers regardless of their internal geometry (e.g., a narrow vertical "i" icon vs a wide horizontal arrow). This prevents layout shifts when swapping icon instances and ensures consistent alignment within buttons and inputs.
Q7 • Governance What is a Component Lifecycle, and what states does a component pass through?
A structured component lifecycle typically includes: 1. Proposal (evaluating if existing components can solve the need), 2. Alpha / Draft (experimental component in a single feature squad), 3. Beta (hardened design tokens and coded component submitted for review), 4. Stable (published in core library with documentation), and 5. Deprecated (flagged for retirement with migration instructions).
Q8 • Documentation What role does Storybook play in maintaining design system integrity?
Storybook serves as an isolated workshop environment where software engineers build, test, and document UI components in all possible states (hover, loading, error, disabled) without the overhead of backend dependencies. It acts as the live coded companion to the Figma library, ensuring pixel-perfect parity between design and code.