switch
This component generates a switch. So this component supports the use case to select or deselect an option. As alternative there is also the checkbox.
You can set different kind of properties like the label or different styling aspects like the colors of the background, the label or the checked state. Further more there are configuration functions for accessing the checked state of this box or totally disable it.
Basic usage
val cheeseStore = storeOf(false)
switch(value=cheeseStore) {
label("with extra cheese") // set the label
}
See also
Parameters
a lambda expression for declaring the styling as fritz2's styling DSL
a boolean store to handle the state and its changes automatically
optional CSS class that should be applied to the element
the ID of the element
the prefix for the generated CSS class resulting in the form `$prefix-$hash`
a lambda expression for setting up the component itself. Details in SwitchComponent