A component for toggling or switching values on or off
Opaque Switch
element that can produce msg
messages
switch : { checked : Basics.Bool, onText : String, offText : String, onChange : Basics.Bool -> msg } -> Switch msg
Constructs a Switch
from the arguments
onText
is the text that will be displayed when the switch is "on", or checked
is trueoffText
is the text that will be displayed when the switch is "off", or checked
is falsewithReversed : Switch msg -> Switch msg
Configures the position of the text to be on the left of the switch
The default position of the text is to the right of the switch.
withText : { onText : String, offText : String } -> Switch msg -> Switch msg
Configures the text display when the switch is "on" or "off"
isChecked : Switch msg -> Basics.Bool
Return true is the element is checked
, otherwise false
markChecked : Switch msg -> Switch msg
Set the checked
value to true
markUnchecked : Switch msg -> Switch msg
Set the checked
value to false
toggleCheck : Switch msg -> Switch msg
Given the internal checked
state, set it to the opposite
toMarkup : Switch msg -> Element msg
Given the custom type representation, renders as an Element msg
.