What Are Design Tokens?
The building blocks of every modern design system.
Design tokens are the atomic building blocks of a design system. They store visual design decisions β colors, typography, spacing, shadows, motion, and more β as platform-agnostic data rather than hard-coded values. Think of them as a single source of truth that bridges design tools and code.
The term was coined by Salesforce in 2014 when building the Lightning Design System. They needed a way to keep their design language consistent across web, iOS, Android, and React Native β all from one set of definitions. The concept has since been adopted by virtually every major design system.
The Variable Analogy
Without tokens
color: #3B82F6;Hard-coded in 47 files. Change one, miss 46.
With CSS variables
color: var(--brand-blue);Better! But only works for web, and names lack intent.
With design tokens
color: {color.action.primary}Platform-agnostic, semantic, single source of truth.
Consistency
Scalability
Multi-platform
Speed
Token Taxonomy
Every visual property your system needs to control.
Design tokens cover every visual property in your design system. Here is a comprehensive breakdown of token types, what they control, and examples of each.
Color
Typography
Spacing
Border Radius
Elevation
Motion
Less common but valuable token types
The Three Tiers of Design Tokens
From raw values to component-specific decisions.
Most mature design systems organize tokens into three tiers. Each tier adds a layer of abstraction, making your system more flexible and maintainable. Hover over each tier to explore.
Global / Primitive
Raw values with no implied usage. Think of these as your design palette β the complete set of options.
color.blue.500#3B82F6color.neutral.900#171717size.spacing.164remfont.weight.semibold600Alias / Semantic
Purpose-driven names that reference primitives. These encode intent β what a value is used for.
color.action.primary{color.blue.500}color.text.default{color.neutral.900}spacing.page.gutter{size.spacing.16}font.heading.weight{font.weight.semibold}Component
Scoped to specific UI components. These are the most specific tokens and reference alias tokens.
button.primary.bg{color.action.primary}button.primary.text{color.text.inverse}card.padding{spacing.page.gutter}heading.h1.weight{font.heading.weight}How tiers enable theming
The power of tiers becomes clear when you need to support multiple themes. In a dark theme, you keep the same alias and component tokens but swap which primitives they point to:
color.bg.default β {color.white} β #FFFFFF
color.text.default β {color.gray.900} β #111827
color.action.primary β {color.blue.600} β #2563EBcolor.bg.default β {color.gray.950} β #030712
color.text.default β {color.gray.100} β #F3F4F6
color.action.primary β {color.blue.400} β #60A5FANaming Conventions
The difference between a system people love and one they abandon.
Good token names are the difference between a system people love and one they abandon. Names should be predictable, scannable, and self-documenting. Explore the most common conventions below.
CTI (CategoryβTypeβItem)
The most popular convention for design tokens. Organizes tokens in a hierarchical taxonomy from broad category to specific item.
{category}.{type}.{item}color.background.primarysize.font.heading-1size.spacing.mediumcolor.border.interactiveNaming principles that always apply
- Name for purpose, not appearance:
color.action.primarynotcolor.blue - Use consistent delimiters (dots, dashes, or slashes β pick one)
- Include state information when relevant: default, hover, active, disabled, focus
- Document the intent of each token in your token spec
- Don't embed raw values in names:
color.blue500 - Don't mix naming conventions within the same tier
- Don't use abbreviations that aren't universally understood
- Don't use ordinal numbers:
spacing.1, spacing.2
Interactive Token Playground
See how token values shape a UI in real time.
Adjust the tokens below and watch the preview update in real time. Try the presets to see how the same component structure can feel completely different just by changing token values. The generated code is ready to copy into your project.
:root {
--color-primary: #3B82F6;
--color-surface: #FFFFFF;
--color-text: #111827;
--radius: 12px;
--spacing: 24px;
--font-size: 15px;
--font-weight: 500;
--shadow: 0 4px 12px rgba(0,0,0,0.10);
}Token Formats & Platform Output
One definition, every platform.
Design tokens are defined in a platform-agnostic format (usually JSON) and then transformed into platform-specific outputs. The W3C Design Tokens Community Group (DTCG) is standardizing a universal format. Below are the same token set expressed in different formats.
/* CSS Custom Properties */
:root {
--color-primary: #3B82F6;
--color-primary-hover: #2563EB;
--color-surface: #FFFFFF;
--color-text: #111827;
--radius-sm: 4px;
--radius-md: 8px;
--radius-lg: 16px;
--spacing-xs: 4px;
--spacing-sm: 8px;
--spacing-md: 16px;
--spacing-lg: 24px;
--spacing-xl: 32px;
--font-size-sm: 0.875rem;
--font-size-md: 1rem;
--font-size-lg: 1.25rem;
--shadow-sm: 0 1px 2px rgba(0,0,0,0.05);
--shadow-md: 0 4px 6px rgba(0,0,0,0.07);
}The W3C Design Tokens Format (DTCG)
The W3C DTCG specification is the emerging standard for design token files. Key features include:
- $value β The token's value (replaces "value" from earlier drafts)
- $type β Declares the token type: color, dimension, fontFamily, fontWeight, duration, cubicBezier, shadow, etc.
- $description β Human-readable description of the token's intent
- References β Use
{color.blue.500}syntax to create alias tokens that point to other tokens - Grouping β Nest tokens in a hierarchy using JSON objects
Design Tokens in the Wild
How the biggest companies structure their tokens.
The best way to learn is from existing design systems. Here's how the biggest companies structure their tokens. Click each system to explore details.
Tools & Ecosystem
From Figma to production in an automated pipeline.
A healthy design token workflow connects design tools, token definitions, and code output. Here are the key tools in the ecosystem.
Token build & transformation tools
Style Dictionary
by Amazon Β· Open Source
The most popular token build tool. Reads JSON/JSONC token files and transforms them into any platform format via a plugin system. Supports the W3C DTCG format.
styledictionary.comToken Transformer
by Tokens Studio Β· Open Source
Converts Tokens Studio for Figma output into Style Dictionary compatible format. Handles references, math operations, and composite tokens.
sd-transforms on GitHubDesign tool integration
Figma Variables
Built-in Β· Figma
Native variable system supporting color, number, string, and boolean types. Modes (light/dark) and scoping (which properties a variable can bind to) built in.
Figma Variables GuideTokens Studio for Figma
Plugin Β· Tokens Studio
Advanced Figma plugin for managing design tokens with Git sync, multi-file token sets, theming, math operations, and direct export to Style Dictionary format.
tokens.studioTypical token workflow
Best Practices
Patterns from dozens of production design systems.
After studying dozens of production design systems, here are the practices that separate good token systems from great ones.
Do
- Start with a small set of global tokens and grow gradually. You can always add more β removing tokens is painful.
- Use semantic tokens for theming. Component code should reference alias tokens, not primitives.
- Version your tokens and treat token changes like API changes. Breaking changes need migration paths.
- Document each token with its intended use case. A token named
color.feedback.warning.bgis clearer with a description like "Background for warning banners and inline alerts." - Automate your token pipeline: Figma β JSON β build tool β code output. Manual steps introduce drift.
- Validate tokens in CI. Lint for missing references, unused tokens, contrast ratios, and naming violations.
- Create a living reference page (like this one!) that shows token values and their visual output side by side.
Don't
- Don't create a token for every single CSS property. Tokens are for design decisions, not exhaustive CSS mappings.
- Don't skip the alias tier and go straight from primitives to components. You'll lose the ability to theme.
- Don't use token names that describe the value:
color.blue-500breaks when your brand changes to purple. - Don't mix token formats in the same project. Pick one source format (JSON, YAML) and generate all others.
- Don't change token values without communication. Token changes can ripple across dozens of components.
- Don't design your token architecture around a specific tool. Tools change; a sound architecture endures.
- Don't conflate design tokens with a component library. Tokens feed components, but they're a separate concern.
Token Maturity Model
Most teams evolve their token practice over time. Here's a rough maturity model to help you gauge where you are and what to aim for next.
Ad-hoc
Hard-coded values scattered across CSS files. No shared vocabulary between design and engineering.
Variables
CSS custom properties or SCSS variables exist, but naming is inconsistent. No multi-platform output.
Structured
Tokens defined in JSON with clear naming conventions. Build tool generates platform outputs. Single tier (global only).
Semantic
Multi-tier tokens (global + alias). Themes are supported by swapping alias mappings. Figma variables synced to code.
Systematic
Full three-tier architecture with component tokens. Automated pipeline from design to code. Token changes are versioned, linted, and reviewed in CI.