What Are Design Tokens?
Design tokens are semantic names for design values that ensure consistency across your application:- Consistency: Use the same values everywhere
- Maintainability: Change values in one place
- Semantics: Names describe purpose, not appearance
- Theming: Swap entire value sets easily
Token Categories
Color Tokens
Background Colors
Used for backgrounds of components and surfaces:Text Colors
Used for text content:Border Colors
Used for borders and dividers:Spacing Tokens
Consistent spacing throughout your UI:Typography Tokens
Font Families
Font Sizes
Font Weights
Line Heights
Sizing Tokens
Border Tokens
Border Widths
Border Radii
Shadow Tokens
Z-Index Tokens
Using Tokens
In Components
Paste components accept tokens through props:With useTheme Hook
Access raw token values:In Custom Themes
Override token values:Token Structure
Tokens follow a consistent naming pattern:-
colorBackgroundPrimaryStrong- Category:
color - Element:
Background - Variant:
Primary - State:
Strong
- Category:
-
colorTextLinkDestructiveWeak- Category:
color - Element:
Text - Variant:
LinkDestructive - State:
Weak
- Category:
Responsive Token Usage
Use tokens responsively with arrays:space30/fontSize20at the smallest breakpointspace50/fontSize30at the medium breakpointspace70/fontSize40at the large breakpoint
Token References
Accessing Token Lists
Import token types for TypeScript support:Token Values
Get actual token values:Best Practices
Use Semantic Tokens
Follow the Scale
Stay Consistent
Reference Theme Tokens
When customizing:Theme Variants
Different themes use different token values:Data Visualization Tokens
Special tokens for charts and graphs:Next Steps
- Learn to Create Custom Themes with token overrides
- Explore Style Props that accept tokens
- Use the Theme Designer to experiment with tokens
- Review CustomizationProvider for applying custom tokens