Switch

A switch widget that can be toggled. Includes Widget API

Properties

selection

Type: boolean, default: false

The checked state of the switch.

thumbOffColor

Type: Color

The color of the movable thumb, when switched off.

thumbOnColor

Type: Color

The color of the movable thumb, when switched on.

trackOffColor

Type: Color

The color of the track that holds the thumb, when switched off.

trackOnColor

Type: Color

The color of the track that holds the thumb, when switched on.

Events

“change:selection” (widget, selection, options)

Parameters:

  • widget: Switch
  • selection: boolean, the current value of selection.
  • options: Object

Fired when the selection property changes.

“select” (widget, selection, options)

Parameters:

  • widget: Switch
  • selection: boolean, the current value of selection.
  • options: Object

Fired when the switch is toggled by the user.