Skip to content

References and Aliases

References let you avoid duplication and build layered token systems: base tokens hold raw values, semantic tokens give them meaning, and component tokens wire them to UI. Change a base token once, and all references update.

Aliases use the {token.path} pattern. The referenced token’s value fully replaces the alias.

{
"color": {
"brand": {
"primary": {
"$type": "color",
"$value": {
"colorSpace": "srgb",
"components": [0, 0.4, 0.8]
}
}
},
"button": {
"background": {
"$value": "{color.brand.primary}"
}
}
}
}

If the alias token omits $type, it inherits from the referenced token. Here, color.button.background has type color from color.brand.primary.

Aliases can reference other tokens inside composite values. The reference is resolved to the referenced token’s value.

{
"border": {
"primary": {
"$type": "border",
"$value": {
"color": "{color.brand.primary}",
"width": { "value": 2, "unit": "px" },
"style": "solid"
}
}
}
}

Complete Example: Base → Semantic → Component

Section titled “Complete Example: Base → Semantic → Component”
{
"color": {
"base": {
"blue-600": {
"$type": "color",
"$value": {
"colorSpace": "srgb",
"components": [0, 0.4, 0.8]
}
}
},
"semantic": {
"primary": {
"$value": "{color.base.blue-600}"
}
},
"button": {
"background": {
"$value": "{color.semantic.primary}"
}
}
}
}

Resolved output (conceptually): all three — color.semantic.primary, color.button.background, and color.base.blue-600 — resolve to { colorSpace: "srgb", components: [0, 0.4, 0.8] }.

JSON Pointer references use the $ref property to point to tokens within the same file or in external files.

Use $ref to point to another token or document. Fragment-only references stay in the same file:

{
"$ref": "#/color/brand/primary"
}

References to other files include the path and fragment:

{
"$ref": "./other-file.json#/color/brand/primary"
}
  • Token-level $ref: The entire token is resolved from the target. No extra properties.
  • Property-level overrides: When an object has both $ref and other properties, those properties override the resolved content. This is common in resolver documents for sets and modifiers.

$ref is mainly used in resolver documents to reference token sets and files. Alias references ({path}) are used inside token files to reference other tokens.

LayerRoleExample
BaseRaw design valuescolor.base.blue-600 = srgb [0, 0.4, 0.8]
SemanticMeaningful abstractionscolor.semantic.primary → base
ComponentUI-specific usagecolor.button.background → semantic

This layering keeps base values centralized and lets you swap semantic mappings per theme or brand.