Field type
range
Slider control for numeric or token-bound values. Supports raw numeric ranges, legacy map configs, and binding to a theme.json token group.
Type: range · Stored attribute type: number
Stored value
number (raw range) OR the token object ({ key, slug, value, cssVar }) when bound to a tokenGroup
Supports
- Raw numeric range with min / max / step
- Legacy
mapconfig — key/value pairs become labelled tick marks tokenGroupbinding — slider snaps between theme.json tokens (spacing scale, font sizes, etc.)- Allow-reset behaviour with a fallback value
Config options
| Option | Type | Default | Description |
|---|---|---|---|
min | number | 0 | Minimum value (ignored when tokenGroup is set). |
max | number | 100 | Maximum value (ignored when tokenGroup is set). |
step | number | 1 | Slider increment (ignored when tokenGroup is set). |
map | object | array | Legacy form. Key/value pairs that produce labelled tick marks. Stored value is the token, not the key. | |
tokenGroup | string | Bind to a theme.json token group (e.g. "spacing"). The slider snaps between tokens and stores the full token object. | |
defaultOptionKey | string | When map or tokenGroup is set, the key to use as default if the saved value is empty. |
Gotchas
- Stored shape depends on config: a raw range stores a number, a
tokenGroupstores{ key, slug, value, cssVar }. Branch on type when reading. - When
tokenGroupis set the displayed min/max/step are derived from the tokens, not frommin/max/stepconfig keys.
Example
{ "id": "ctrl_columns",
"type": "range",
"label": "Columns",
"attributeKey": "columns",
"default": 3,
"min": 1,
"max": 6,
"parentPanelId": "panel" }Every field also takes the keys common to all fields.