range
Slider control for numeric or token-bound values. Supports raw numeric ranges, legacy `map` configs, and binding to a theme.json token group.
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 `map` config — key/value pairs become labelled tick marks
- `tokenGroup` binding — slider snaps between theme.json tokens (spacing scale, font sizes, etc.)
- Allow-reset behaviour with a fallback value
Config options
minnumberdefault:0- Minimum value (ignored when `tokenGroup` is set).
maxnumberdefault:100- Maximum value (ignored when `tokenGroup` is set).
stepnumberdefault:1- Slider increment (ignored when `tokenGroup` is set).
mapobject | array- Legacy form. Key/value pairs that produce labelled tick marks. Stored value is the token, not the key.
tokenGroupstring- Bind to a theme.json token group (e.g. `"spacing"`). The slider snaps between tokens and stores the full token object.
defaultOptionKeystring- When `map` or `tokenGroup` is set, the key to use as default if the saved value is empty.
Example
json
{ "id": "ctrl_columns",
"type": "range",
"label": "Columns",
"attributeKey": "columns",
"default": 3,
"min": 1,
"max": 6,
"parentPanelId": "panel" }
Gotchas
Heads up
Stored shape depends on config: a raw range stores a number, a `tokenGroup` stores `{ key, slug, value, cssVar }`. Branch on type when reading.
Heads up
When `tokenGroup` is set the displayed min/max/step are derived from the tokens, not from `min`/`max`/`step` config keys.