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

Field checkbox ​

Version: Free.

Why this type ​

One checkbox for one option. The saved value is yes or no, not the string "1" or "0". With showWhen it shows or hides other fields.

When to use ​

  • "Show button", "Open in new tab"
  • Enable block or overlay flag
  • showWhen trigger for dependent fields

Tips ​

Multiple independent flags use checkboxgroup. Visible on/off switch fits toggle better.

Similar types ​

Schema ​

json
{
  "name": "featured",
  "type": "checkbox",
  "label": "Featured",
  "tab": "Content",
  "width": 100,
  "active": true
}

Value ​

Boolean.

Section data ​

Key featured in the section data:

json
{
  "featured": true
}

Chunk example ​

modx
<span class="badge">Featured</span>
fenom
{if $featured}<span class="badge">Featured</span>{/if}

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 ​