GCBGutenberg
Control Blocks
Buy

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 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

OptionTypeDefaultDescription
minnumber0Minimum value (ignored when tokenGroup is set).
maxnumber100Maximum value (ignored when tokenGroup is set).
stepnumber1Slider increment (ignored when tokenGroup is set).
mapobject | arrayLegacy form. Key/value pairs that produce labelled tick marks. Stored value is the token, not the key.
tokenGroupstringBind to a theme.json token group (e.g. "spacing"). The slider snaps between tokens and stores the full token object.
defaultOptionKeystringWhen 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 tokenGroup stores { key, slug, value, cssVar }. Branch on type when reading.
  • When tokenGroup is set the displayed min/max/step are derived from the tokens, not from min/max/step config keys.

Example

JSON
{ "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.

Built from GCB Lite 0.4.0 (ce232d4). Source: schemas/controls/range.md.

Copyright © 2026 Runchain. WordPress is a trademark of the WordPress Foundation.