Skip to content
  1. Extras
  2. PageBuilder
  3. Field types
  4. Free
  5. radio

Field radio ​

Version: Free.

Why this type ​

Every choice is visible. You do not open a dropdown. The options list is the same as select. It fits two to five choices when only one can be picked.

When to use ​

  • Alignment left / center / right
  • Background type image / color / video
  • Small labeled choice sets

Tips ​

Long lists belong in select. Simple on/off is faster with yesno or toggle.

Similar types ​

Schema ​

json
{
  "name": "align",
  "type": "radio",
  "label": "Alignment",
  "options": [
    {
      "label": "Left",
      "value": "left"
    },
    {
      "label": "Center",
      "value": "center"
    }
  ],
  "tab": "Content",
  "width": 100,
  "active": true
}

Value ​

Selected option value string.

Section data ​

Key align in the section data: selected option value string:

json
{
  "align": "lg"
}

Chunk example ​

modx
<div class="align-[[+align]]">
  …
</div>
fenom
<div class="align-{$align|escape}">
  …
</div>

Common properties ​

For fields with name that are stored in the section data:

KeyTypeRoleCMP
tabstringGroup subtitle in the inspectoryes
width25–100Field width as % of the row (flex)yes
descriptionstringHint under the labelyes
defaultanyInitial value for a new sectionyes
activeboolfalse hides the field in the inspectoryes
requiredboolRequired on publish (draft still saves)yes

See fields overview.

See also ​