Skip to main content

Toggle

The toggle component allows you to get a boolean from the user.

Toggle API

The following section details Toggle component's specific settings. For more details on the App editor, check the dedicated documentation or the App editor Quickstart:

Controls

This component can be controlled by frontend scripts using these functions:

NameParametersDescriptionExample
setValueid: string, value: anyManually set or force the value of a component.setValue(id: 'a', value: 17)

Toggle configuration

NameTypeConnectableTemplatableDefaultDescription
labelstringtruefalseLabelThe toggle label.
default valuebooleantruefalseThe default value of the toggle.
DisabledbooleanfalsefalsefalseWhether the toggle should be disabled.

Outputs

NameTypeDescription
resultbooleanThe state of the toggle.

Event handlers

The toggle component has the following event handlers:

  • onSuccess: Trigger one or more runnables when the user toggles the switch and the value is true.
  • onToggle: Trigger one or more runnables when the user toggles the switch.