Skip to content
Tutorials Center
My learning

Topics

Lesson 29 of 36 ยท Design Systems and Variables

Building a Design System

Plan and build a Figma design system: foundations (color, type, spacing), contrast checks, a component library and documentation that teams actually use.

A design system is a set of shared decisions, parts and rules that lets many people build a consistent product. It has three layers: foundations (color, type, spacing, elevation), components (buttons, inputs, navigation), and guidance (when to use what, accessibility, voice). Figma provides the tools to hold all three in one place, but the discipline of building one is mostly about decisions, not features.

Figma cannot run on this site. The code is a set of labelled JavaScript stand-ins for calculators you would otherwise do by hand (contrast, type scale, spacing). They are not Figma features.

Start small and real

Do not begin with 80 components. Audit one or two real screens, list what repeats (buttons, text fields, cards), and design those first. A system succeeds when teams find it faster than drawing from scratch, so cover the most-used 20 percent first.

A practical order:

  1. Audit existing designs; screenshot repeated elements.
  2. Foundations: colors, type, spacing, radius, elevation as variables and styles.
  3. Core components: button, input, checkbox, radio, toggle, select, link, icon.
  4. Patterns: forms, cards, modals, navigation.
  5. Documentation and release.
flowchart LR
    A["Audit"] --> B["Foundations"] --> C["Core components"] --> D["Patterns"] --> E["Docs + publish"] --> F["Feedback"] --> B

Design systems are loops: usage feedback reshapes the foundations.

Foundation 1: color and contrast

Choose a neutral scale (gray) of about ten steps, one or two brand hues with ten steps each, and status colors (success, warning, danger, info). Then map them to semantic tokens as in Design Tokens.

Contrast is non-negotiable. WCAG 2.2 requires a contrast ratio of at least 4.5:1 for normal text and 3:1 for large text (about 24 px regular or 19 px bold) and for UI components like input borders. The stand-in below computes the ratio from two hex colors using the WCAG formula.

JS Stand-in: WCAG contrast checker

Press Run (or Ctrl + Enter) to see the console output here.

No output.

White on blue-400 fails for body text. That is the kind of surprise you want to catch before it becomes a button used 400 times.

Foundation 2: type scale

Pick a base size (16 px) and a ratio to generate the sizes: 1.2 (minor third) for compact UIs, 1.25 (major third) for general use, 1.333 for expressive layouts. Round to whole pixels and give each step a role: caption, body, subtitle, heading 3, heading 2, heading 1, display.

JS Stand-in: type scale generator

Press Run (or Ctrl + Enter) to see the console output here.

No output.

Create a Figma text style per role (family, size, weight, line height, letter spacing). Use line height of about 1.4 to 1.6 for body and 1.1 to 1.3 for large headings.

Foundation 3: spacing and layout

Choose a base unit of 4 or 8 px and use multiples (4, 8, 12, 16, 24, 32, 48, 64). Make them number variables space/1 ... space/8, and bind them to auto layout padding and gaps. For layouts, define layout grids (for example 12 columns on desktop, 4 on mobile) as styles.

Components

Build each component with properties and variants, all spacing and color bound to variables, and auto layout throughout. For each include: all states (default, hover, focus, pressed, disabled, error), sizes, light and dark modes via variables, and a visible focus ring that meets 3:1 contrast. Name the layers consistently so swapping works.

Add a description to every component stating when to use it and linking to code docs.

Documentation

Documentation is what separates a library from a system. For each component write: purpose, anatomy (a labelled diagram), variants and properties, do and don't examples, accessibility notes (keyboard behavior, labels, contrast) and code status. Put docs in Figma pages or a separate site; many teams use a template frame called a "spec sheet".

Accessibility baked in

  • Minimum touch target 44 by 44 pt (iOS) or 48 by 48 dp (Android).
  • Never rely on color alone for meaning; add icons or text.
  • Provide visible focus states.
  • Include text-size and reduced-motion notes in guidance.

A completeness checklist

JS Stand-in: system completeness checklist

Press Run (or Ctrl + Enter) to see the console output here.

No output.

Check your understanding

Quick check ยท 4 questions

of 4 answered You scored / 4 ยท perfect!

  1. 1. What is the minimum WCAG contrast ratio for normal body text?

    WCAG AA requires 4.5:1 for normal text and 3:1 for large text.
  2. 2. What is a good first step when starting a design system?

    An audit shows what really repeats, so you build what is used most.
  3. 3. A base spacing unit is usually...

    A 4 or 8 unit scale keeps layouts aligned and consistent.
  4. 4. Which makes a library into a system?

    Documentation and rules explain how to use the parts correctly.

Summary

  • A design system is foundations, components and guidance.
  • Start with an audit and the most-used components.
  • Check contrast (4.5:1 text, 3:1 large text and UI) and use a modular type scale.
  • Use a 4 or 8 spacing unit stored as variables.
  • Build components with states, variables, auto layout and descriptions, then document them.

Next: Publishing Libraries and Versioning