Switch

The Switch allows the user to make a basic "Yes or No" decision, i.e. it represents an input for a boolean value. This is useful either as part of a form, or as a stand-alone toggle for basic filters for tables and similar use cases.

Properties

The Switch component offers the following configuration properties.

Events

The Switch offers three events, that are all related to the UI event when the switch is toggled:

  • On change: This event is triggered whenever the switch is toggled, regardless whether activated or deactivated.

  • On false: This event is triggered whenever the switch is deactivated. This is equivalent to an action running at "On change", with a condition like if (!mySwitch.value) { ... } inside.

  • On true: This event is triggered whenever the switch is activated. This is equivalent to an action running at "On change", with a condition like if (mySwitch.value) { ... } inside.

API

The Switch exposes the following API in the JavaScript runtime environment.

Last updated