GCBGutenberg
Control Blocks
Buy

Field type

select

Dropdown single-select. Supports plain options, legacy map configs, and tokenGroup binding to theme.json tokens.

Type: select · Stored attribute type: string

Stored value

string for plain options OR a full token object ({ key, slug, value, cssVar }) when bound to a tokenGroup

Supports

  • Plain { value, label } option lists
  • Legacy map configs (key/value pairs that map keys to richer values)
  • tokenGroup binding — options come from a theme.json token group
  • Optional tokenKeys filter to narrow a token group to specific keys
  • Auto-prepended placeholder option when no defaultOptionKey is set

Config options

OptionTypeDefaultDescription
options{ value, label }[]The choices for plain-list mode.
mapobject | arrayLegacy form. Key/value pairs mapping option keys to richer values.
tokenGroupstringBind to a theme.json token group (e.g. "color", "font-size"). Stored value becomes the full token object.
tokenKeysstring[]When tokenGroup is set, restrict to these token keys only.
defaultOptionKeystringInitial value if the field is empty.
placeholderstringLabel for the auto-prepended empty option.

Gotchas

  • Stored shape depends on config: plain options store the string value, tokenGroup stores { key, slug, value, cssVar }. Branch on type when reading.
  • For multi-select use checkbox-group (vertical) or button-group (horizontal).

Example

JSON
{ "id": "ctrl_size",
  "type": "select",
  "label": "Size",
  "attributeKey": "size",
  "default": "m",
  "options": [
    { "value": "s", "label": "Small" },
    { "value": "m", "label": "Medium" },
    { "value": "l", "label": "Large" }
  ],
  "parentPanelId": "panel" }

Every field also takes the keys common to all fields.

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

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