Variables + Property Types

In the Universal Design System (UDS), property types help define and control how components behave, look, and adapt across contexts.

πŸ“‚ Types of Properties

Figma supports four main variable types. Each has specific use cases within our system:

πŸŸ₯ 1. Color Variables

Used to define visual styling (e.g., fills, strokes, text).

  • Example values: #000000, #FFCD29

  • Supports light/dark themes, semantic tokens, and brand palettes

  • Can be aliased for token layering (e.g., content/01 β†’ grey-style/onyx/01)

πŸ”— Commonly applied to:

  • Fill & stroke

  • Text color

  • Shadow/blur color

  • Gradients


πŸ”’ 2. Number Variables

Used to define numeric values such as spacing, sizing, and typography.

  • Example values: 16, 0, -8, 12.5

  • Can be used for responsive layouts, font styles, and layout grids

πŸ”— Commonly applied to:

  • Font size, weight, line height, letter spacing

  • Padding, margins, gaps

  • Corner radius

  • Layout grids and alignment


πŸ”€ 3. String Variables

Used to define text and string-based values, including copy and font family names.

  • Example values: "Hello, world!", "Inter", "Bold Italic"

  • Supports localization, text-based token values, and font styling

πŸ”— Commonly applied to:

  • Text content

  • Font family or weight (by name)

  • Variant values in prototyping

  • Visibility toggles using string conditions


βœ… 4. Boolean Variables

Used to toggle true/false states, often for conditional rendering.

  • Example values: true, false

  • Great for hiding/showing layers and toggling visual states

πŸ”— Commonly applied to:

  • Layer visibility

  • Boolean variants (e.g., show icon, outline mode, descriptive image)


πŸ” Aliasing (Design Token Support)

A variable can reference another variable of the same type β€” this is called aliasing. It’s how UDS supports design tokens with layered naming (e.g., border/01 β†’ brand-style/sun/01 β†’ #FFCD29).

Benefits:

  • Easier theme switching

  • More readable token names

  • System-wide updates by changing a single value


πŸ—‚ Collections, Groups & Modes

To manage complexity and scale, variables are organized using:

πŸ“¦ Collections

  • A set of variables (e.g., all spacing tokens, all brand colors)

  • Each collection can contain up to 5,000 variables

  • Includes all related modes

πŸ—ƒ Groups

  • Nested folders within collections for better organization

  • Example: In a color collection, you might have groups like:

    • content/

    • surface/

    • status/

πŸŽ› Variable Modes

Modes define contextual values for the same variable (e.g., light/dark, mobile/desktop).

Example:

Last updated

Was this helpful?