Tokens

Other

Other group token types: Grid, Boolean, String (text), Template, Composition, Custom — verified value shapes, keys, and usage patterns.

Overview

$typeExports asValue in one line
gridGrid styleOne grid object or an array of grids
booleanVariable (BOOLEAN)true / false (string literals accepted)
textVariable (STRING)Any string
templateInternal (applied)A style preset (object) or a template file
compositionInternal (applied)A component definition (see Composition)
customInternal (or inferred)Any JSON value

Grid

Frame layout grids. Exported as a grid style. One object or an array of grid definitions.

KeyValues
patterncolumns, rows, grid
countNumber (for columns / rows)
sectionSizeCell / track size (number / string)
gutterSizeGutter (number / string)
alignmentMIN, MAX, CENTER, STRETCH
offsetOffset (number / string)
JSON
{
  "grid": {
    "$type": "grid",
    "desktop": {
      "$value": { "pattern": "columns", "count": 12, "gutterSize": 24, "alignment": "STRETCH", "offset": 0 }
    },
    "editor": {
      "$value": [
        { "pattern": "columns", "count": 12, "gutterSize": 24, "alignment": "STRETCH" },
        { "pattern": "rows", "sectionSize": 8, "gutterSize": 8, "alignment": "MIN" }
      ]
    }
  }
}

Note Layout grids apply to frame-like nodes only.


Boolean

Exported as a BOOLEAN variable. Default scope ALL_SCOPES.

Accepted $valueResolves to
true / falseas-is
"on" / "off"true / false
"yes" / "no"true / false
"1" / "0"true / false
Aliastarget
JSON
{ "flags": { "$type": "boolean", "compact": { "$value": false }, "beta": { "$value": true } } }

String (text)

Plain string constants. Exported as a STRING variable. Default scope ALL_SCOPES.

JSON
{ "label": { "$type": "text", "cta": { "$value": "Get started" }, "currency": { "$value": "USD" } } }

Template

A style preset used by Apply Template workflows (applied directly, not exported). Two shapes are supported.

1) DTCG-style token$value is a style object:

JSON
{
  "template": {
    "$type": "template",
    "card-default": {
      "$value": {
        "direction": "column",
        "widthType": "fill",
        "padding": "16 16",
        "gap": 8,
        "borderRadius": 12,
        "background": "{color.surface.base}",
        "boxShadow": "{shadow.card}"
      }
    }
  }
}

2) Template file — a root object with name + styles variants:

JSON
{
  "$type": "template",
  "name": "Card",
  "styles": {
    "default": { "direction": "column", "padding": "16 16", "borderRadius": 12, "background": "{color.surface.base}" },
    "compact": { "direction": "column", "padding": "12 12", "borderRadius": 10, "background": "{color.surface.base}" }
  }
}

Template style keys are the same as composition styles. The common ones by group:

GroupKeys
Layoutdirection, justifyContent, alignItems, gap, padding, overflow
SizewidthType, heightType, width, height, minWidth, maxWidth, minHeight, maxHeight
Positionposition, top, right, bottom, left, x, y, alignSelf, rotate
Background & colorbackground, fill, color
Bordersborder, borderColor, borderWidth, borderRadius, strokeAlign
EffectsboxShadow, effects, backgroundBlur, layerBlur, glass, opacity
TypographyfontFamily, fontWeight, fontSize, lineHeight, letterSpacing, textCase, textDecoration

Each key's exact values are documented on Composition · Styles, where the same style contract is described in full.


Composition

composition describes a Figma component as JSON (structure, props, styles, and more). It has its own full contract — see Composition.

JSON
{ "$type": "composition", "name": "WButton", "structure": { "tag": "FRAME", "class": "root" }, "styles": { ".root": {} } }

Custom

custom (or a clean project-specific $type such as "baseUnit") holds any JSON value and stays editable in SXL Studio.

JSON
{ "meta": { "$type": "custom", "gridUnit": { "$value": 4 }, "config": { "$value": { "spacingScale": 1.5 } } } }

On Export Variables & Styles, SXL infers a safe target from the $value shape: #112233 → color, numbers → number, booleans → boolean, CSS gradients → paint. Values it cannot infer safely stay opaque/internal.