lenards / elm-ui-patternfly / PF4.Switch

A component for toggling or switching values on or off

Definition


type Switch msg

Opaque Switch element that can produce msg messages

Constructor function

switch : { checked : Basics.Bool, onText : String, offText : String, onChange : Basics.Bool -> msg } -> Switch msg

Constructs a Switch from the arguments

Configuration functions

withReversed : 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"

State change functions

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

Rendering element

toMarkup : Switch msg -> Element msg

Given the custom type representation, renders as an Element msg.