Skip to content

Token Types

DTCG token types fall into two categories: primitive types (single values) and composite types (structured objects combining primitives). Color tokens have their own spec module; all other types live in the format module.

Composite Types

shadow
"$value": {
  "color": {
    "colorSpace": "srgb",
    "components": [0, 0, 0],
    "alpha": 0.25
  },
  "offsetX": { "value": 0, "unit": "px" },
  "offsetY": { "value": 4, "unit": "px" },
  "blur": { "value": 8, "unit": "px" },
  "spread": { "value": 0, "unit": "px" }
}
HeadingBody text sample at 16px
typography
"$value": {
  "fontFamily": ["Inter", "sans-serif"],
  "fontSize": { "value": 16, "unit": "px" },
  "fontWeight": 600,
  "letterSpacing": { "value": 0, "unit": "px" },
  "lineHeight": 1.5
}
border
"$value": {
  "color": {
    "colorSpace": "srgb",
    "components": [0.49, 0.23, 0.93]
  },
  "width": { "value": 2, "unit": "px" },
  "style": "solid"
}
strokeStyle
"$value": {
  "dashArray": [
    { "value": 4, "unit": "px" },
    { "value": 2, "unit": "px" }
  ],
  "lineCap": "round"
}
transition
"$value": {
  "duration": { "value": 200, "unit": "ms" },
  "delay": { "value": 0, "unit": "ms" },
  "timingFunction": [0.25, 0.1, 0.25, 1]
}
gradient
"$value": [
  {
    "color": {
      "colorSpace": "srgb",
      "components": [0.49, 0.23, 0.93]
    },
    "position": 0
  },
  {
    "color": {
      "colorSpace": "srgb",
      "components": [0.02, 0.71, 0.83]
    },
    "position": 1
  }
]

A color value in a given color space. Component ranges depend on the color space (e.g. sRGB uses 0—1 per channel; HSL uses 0—360 for hue and 0—100 for saturation/lightness).

{
"$type": "color",
"$value": {
"colorSpace": "srgb",
"components": [0, 0.4, 0.8],
"alpha": 1
}
}

Supported color spaces: srgb, srgb-linear, display-p3, a98-rgb, prophoto-rgb, rec2020, hsl, hwb, lab, lch, oklab, oklch, xyz-d50, xyz-d65. The alpha property is optional and defaults to 1. An optional hex property can provide a 6-digit CSS hex fallback (e.g. "#ff00ff"). Individual components may also be the string "none" to indicate a missing or powerless component (e.g. hue in an achromatic color).

A numeric value with a unit. Supports px and rem.

{
"$type": "dimension",
"$value": {
"value": 16,
"unit": "px"
}
}

A font family name or fallback stack.

{
"$type": "fontFamily",
"$value": ["Inter", "sans-serif"]
}

Font weight as a number (1—1000) or named string (e.g. thin, normal, bold, extra-bold).

{
"$type": "fontWeight",
"$value": "bold"
}

A time duration in milliseconds or seconds.

{
"$type": "duration",
"$value": {
"value": 200,
"unit": "ms"
}
}

A cubic Bezier curve defined by four control points.

{
"$type": "cubicBezier",
"$value": [0.25, 0.1, 0.25, 1]
}

A plain numeric value without units.

{
"$type": "number",
"$value": 1.5
}

A box shadow. Use an array for multiple shadows. The optional inset property (default false) controls whether the shadow renders inside the element as an inner shadow.

{
"$type": "shadow",
"$value": {
"offsetX": { "value": 0, "unit": "px" },
"offsetY": { "value": 4, "unit": "px" },
"blur": { "value": 8, "unit": "px" },
"spread": { "value": 0, "unit": "px" },
"color": {
"colorSpace": "srgb",
"components": [0, 0, 0],
"alpha": 0.25
},
"inset": true
}
}

A combination of font properties.

{
"$type": "typography",
"$value": {
"fontFamily": ["Inter", "sans-serif"],
"fontSize": { "value": 16, "unit": "px" },
"fontWeight": 600,
"lineHeight": 1.5,
"letterSpacing": { "value": 0.16, "unit": "rem" }
}
}

Border color, width, and style.

{
"$type": "border",
"$value": {
"color": {
"colorSpace": "srgb",
"components": [0, 0.4, 0.8]
},
"width": { "value": 1, "unit": "px" },
"style": "solid"
}
}

Stroke configuration for vectors. Can be a string or an object with dashArray and lineCap.

{
"$type": "strokeStyle",
"$value": {
"dashArray": [
{ "value": 4, "unit": "px" },
{ "value": 2, "unit": "px" }
],
"lineCap": "round"
}
}

Animation transition properties.

{
"$type": "transition",
"$value": {
"duration": { "value": 200, "unit": "ms" },
"delay": { "value": 0, "unit": "ms" },
"timingFunction": [0.25, 0.1, 0.25, 1]
}
}

A gradient defined by color stops.

{
"$type": "gradient",
"$value": [
{
"color": { "colorSpace": "srgb", "components": [0, 0.4, 0.8] },
"position": 0
},
{
"color": { "colorSpace": "srgb", "components": [0, 0.8, 0.4] },
"position": 1
}
]
}