Skip to content

Switch ​

The Switch is a standard Switch element with click handling and state management.

Extends: VisualElement

Properties ​

PropertyTypeDefaultDescription
checkedbooleanWhetherswitch is checked
textstringTextto display next to switch
autoSizebooleanWhetherto automatically size the element to fit switch and text
onBackgroundnumberBackgroundcolor when ON
offBackgroundnumberBackgroundcolor when OFF

Released under the MIT License.