D
D
Developers
Search…
Token Groups
The token group defines one logical group of colors, fonts, gradients, or any other design tokens. Each token group always contains only one type of token that corresponds with it.

Example Token Group Payload

This is what the payload of one group looks like:
1
{
2
"id": string
3
"name": string
4
"description": string
5
"path": [string]
6
"tokenType": "Color" | "Typography" | "Radius" | "Font" | "Measure" | "Shadow" | "Border" | "Gradient" | "Text"
7
"isRoot": boolean
8
"tokenIds": [string]
9
"subgroups": [Token Group]
10
}
Copied!
Token groups form a tree of dependencies. There is always one root of the tree representing one type of token, such as Color. When a group has subgroups, the payload will look like this:
1
{
2
"id": string
3
"name": string
4
"description": string
5
"path": [string]
6
"tokenType": "Color" | "Typography" | "Radius" | "Font" | "Measure" | "Shadow" | "Border" | "Gradient" | "Text"
7
"isRoot": boolean
8
"tokenIds": [string]
9
"subgroups": [{
10
"id": string
11
"name": string
12
"description": string
13
"path": [string]
14
"tokenType": "Color" | "Typography" | "Radius" | "Font" | "Measure" | "Shadow" | "Border" | "Gradient" | "Text"
15
"isRoot": boolean
16
"tokenIds": [string]
17
"subgroups": [Token Group]
18
}]
19
}
Copied!
Because the tree can only be constructed with groups and tokens of the same type, the type of all groups and tokens in one tree will be the same as the type of root group.

Associated functions

You can use the following functions to retrieve token groups from your design system:
Last modified 6mo ago