Tokensets
Tokensets are collections of related design tokens within a workspace. They help organize tokens by category, component, or any logical grouping that makes sense for your design system.What is a Tokenset?
A tokenset is a group of design tokens that share a common purpose or category. Each tokenset belongs to a workspace and can have multiple modes (like light and dark themes).Example Structure
Creating a Tokenset
Tokenset Properties
| Property | Type | Description |
|---|---|---|
id | string | Unique identifier |
workspace_id | string | Parent workspace ID |
name | string | Tokenset name |
description | string | Optional description |
created_at | timestamp | Creation date |
updated_at | timestamp | Last update date |
Common Tokenset Categories
1. Colors
All color-related tokens:- Brand colors
- Semantic colors (success, error, warning)
- Background colors
- Text colors
2. Typography
Font-related tokens:- Font families
- Font sizes
- Font weights
- Line heights
- Letter spacing
3. Spacing
Layout and spacing tokens:- Margins
- Padding
- Gap values
- Layout units
4. Sizing
Dimension tokens:- Component sizes
- Icon sizes
- Border widths
5. Effects
Visual effects:- Shadows
- Border radius
- Transitions
- Animations
Multi-mode Support
Each tokenset can have multiple modes for different contexts:Best Practices
1. Logical Grouping
Group tokens by category:- ✅ Separate tokenset for colors, typography, spacing
- ❌ Mixing all token types in one tokenset
2. Clear Naming
Use descriptive, consistent names:- ✅ “Core Colors”, “Typography”, “Component Spacing”
- ❌ “Tokens1”, “TS”, “Misc”
3. Documentation
Add descriptions to explain purpose:4. Modular Organization
Create focused tokensets:- ✅ Small, specific tokensets
- ❌ One giant tokenset with everything