Design Tokens
Design tokens are named design decisions that store the small reusable values of an interface.
They turn raw values into shared references that can be used across design files, code, documentation, and Design System components.
Core Idea
A token gives meaning to a value.
| Raw value | Token | Meaning |
|---|---|---|
#3E4FC8 | color-background-primary | primary background color |
16px | spacing-md | medium spacing value |
700 | font-heading-weight | heading font weight |
8px | radius-small | small corner radius |
The value can change, but the decision remains understandable because the name explains the role.
Why Tokens Matter
Design tokens help with:
- consistency
- single source of truth
- developer handoff
- theme changes
- accessibility adjustments
- system maintenance
- faster updates across many components
Without tokens, the same decision gets copied into many places. With tokens, the decision has one controlled reference.
What Tokens Can Control
Tokens can describe:
- color
- typography
- spacing
- sizing
- radius
- shadow
- elevation
- motion
- opacity
- border
- layout
- breakpoint
- z-index
They are not limited to colors.
Complete Token System
A complete token system is not only a list of values.
It connects raw values, semantic meaning, component usage, states, themes, and governance.
raw value -> primitive token -> semantic token -> component token -> product UIThe system should answer five questions:
| Question | Token responsibility |
|---|---|
| What is the raw value? | primitive tokens |
| What does the value mean? | semantic tokens |
| Where is the value used? | component tokens |
| When does the value change? | state, mode, and theme tokens |
| Who can change the value? | governance and documentation |
Token Levels
| Level | Question | Example | Role |
|---|---|---|---|
| primitive / global | what is the value? | color-blue-500, font-size-100, spacing-4 | basic named building block |
| semantic / alias | what does it mean? | color-text-primary, font-size-body-md, spacing-content-gap | design decision with interface meaning |
| component / specific | where is it used? | button-background-primary, input-border-error, card-padding-default | context-specific component decision |
Primitive tokens describe what the value is.
Semantic tokens describe what the value does.
Component tokens describe where the value is used.
State, mode, and theme tokens are dimensions that can modify semantic or component tokens.
Examples:
button-background-primary-hoverbutton-background-primary-disabledcolor-background-primary-lightcolor-background-primary-darkcolor-text-error
Token Categories
| Category | What It Defines | Example Tokens |
|---|---|---|
| color | brand, surface, text, border, feedback, focus | color-brand-500, color-text-primary, color-border-subtle, color-feedback-error |
| typography | font family, size, weight, line-height, letter spacing | font-family-body, font-size-body-md, font-weight-heading, line-height-reading, letter-spacing-label |
| spacing | gaps, padding, margins, stack rhythm | spacing-xs, spacing-md, spacing-content-gap, spacing-section |
| sizing | icon size, control height, target size, fixed dimensions | size-icon-sm, size-control-md, size-touch-target |
| radius | corner shape and component softness | radius-sm, radius-card, radius-pill |
| border | border width, style, and semantic border color | border-width-default, border-color-focus, border-color-error |
| shadow / elevation | depth, layering, floating surfaces | shadow-card, shadow-popover, elevation-modal |
| motion | duration, easing, delay, transition behavior | duration-fast, duration-standard, easing-enter, easing-exit |
| opacity | disabled states, overlays, scrims, subtle surfaces | opacity-disabled, opacity-overlay, opacity-muted |
| layout | containers, grids, breakpoints, z-index | container-width-lg, grid-gap-default, breakpoint-md, z-index-modal |
Typography tokens are especially useful because text decisions are repeated across headings, body copy, labels, buttons, inputs, navigation, and error messages.
Good typography token groups usually include:
- font family
- font size
- font weight
- line height
- letter spacing
- paragraph spacing
- text case when it is part of the system
Example Of Token Architecture
#3E4FC8
-> color-blue-500
-> color-background-primary
-> button-background-primary
16px
-> font-size-100
-> font-size-body-md
-> input-label-font-sizeThis structure makes change easier.
If the brand blue changes, the primitive value can change. If only the button needs a different color, the component token can change without breaking every other primary background.
If the body text scale changes, the semantic typography token can change. If only input labels need a smaller size, the component token can change without changing body copy everywhere.
Naming Pattern
Useful token names often follow this structure:
object category property modifierExamples:
color-text-primarybutton-background-secondary-hoverfont-size-smradius-smallinput-border-error
Naming Rules
Good token names should:
- describe responsibility, not taste
- avoid vague names like
nice-blue - avoid raw-value names at semantic levels
- use only the levels needed
- keep names understandable
- separate category and property correctly
For example:
| Weak name | Better name | Why |
|---|---|---|
blue-button | button-background-primary | describes use, not only appearance |
big-text | font-size-lg | uses a scale |
red-error | color-text-error | explains semantic role |
Design Tokens And Accessibility
Tokens are useful for Accessibility because accessible decisions can be built into the system.
Examples:
- text colors can be paired with background tokens that pass contrast
- focus-ring tokens can preserve visibility
- spacing and target-size tokens can support touch accessibility
- typography tokens can support readable scales
If accessibility is in the token layer, it becomes easier to preserve across the interface.
Design Tokens And Atomic Design
In Atomic Design, tokens sit before atoms.
They shape the smallest visible interface parts, such as buttons, labels, icons, fields, and headings.