Skip to main content
A toggle flips a boolean. CreateSwitch is an alias for the same element.
Toggle elements, one on and one off

Properties

name
string
The label.
description
string
Hint text under the label. Optional.
icon
string | number
An icon shown beside the label. Optional.
value
boolean
default:"false"
The initial state.
flag
string
default:"name"
The save key. Optional.
forgetState
boolean
default:"false"
Skip saving.
callback
function
Runs with the new value on every change.

Handle

.value
boolean
The current state.
Set(value, skipCallback?)
Set the state. Pass true as the second argument to skip the callback.