GCBGutenberg
Control Blocks
Buy

Field type

button-group

Multi-select shown as a row of pressable buttons. Same stored shape as checkbox-group — only the visual affordance differs (buttons-in-a-row vs checkboxes-in-a-column).

Type: button-group · Stored attribute type: array

Stored value

array of strings — the selected option values

Supports

  • Multi-select from a fixed list of options
  • Horizontal, compact visual style
  • Default selection via default array

Config options

OptionTypeDefaultDescription
options{ value, label }[]The choices. Required.
defaultstring[]Pre-selected values. Empty array if omitted.

Gotchas

  • Not single-select. For a segmented single-choice control use toggle-group — button-group stores an ARRAY of values.

Example

JSON
{ "id": "ctrl_sizes",
  "type": "button-group",
  "label": "Sizes",
  "attributeKey": "sizes",
  "default": ["m"],
  "options": [
    { "value": "s", "label": "S" },
    { "value": "m", "label": "M" },
    { "value": "l", "label": "L" }
  ],
  "parentPanelId": "panel" }

Every field also takes the keys common to all fields.

Built from GCB Lite 0.4.0 (ce232d4). Source: schemas/controls/button-group.md.

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