Skip to content

Toggle Control

On/off switch control for boolean values.

OptionTypeDefaultDescription
labelstring-Field label
controlstringtoggleControl type
defaultbooleanfalseDefault value
{
"attributes": {
"showTitle": {
"type": "boolean",
"default": true,
"wbs": {
"label": "Show Title",
"control": "toggle"
}
}
}
}
{% if attributes.showTitle %}
<h2 class="block-title">{{ attributes.title }}</h2>
{% endif %}

Use Toggle for:

  • Enabling/disabling features
  • Showing/hiding sections
  • Any binary on/off settings