lenards/elm-ui-patternfly/2.1.0

NOTE: the latest version is 4.0.2

PF6.Switch

PF6 Switch component

A switch toggles the state of a setting on or off.

See: https://www.patternfly.org/components/switch

Definition

type Switch msg

Opaque Switch type

Constructor

switch : { onChange : Bool -> msg } -> Switch msg

Construct a Switch

switch { onChange = ToggleFeature }

Content modifiers

withLabel : String -> Switch msg -> Switch msg

Set the "on" label (shown when checked)

withLabelOff : String -> Switch msg -> Switch msg

Set a separate "off" label (shown when unchecked)

withAriaLabel : String -> Switch msg -> Switch msg

Set aria-label for accessibility

State modifiers

withChecked : Bool -> Switch msg -> Switch msg

Set checked state

Disable the switch

Place the label before the toggle (reversed layout)

Rendering

toMarkup : Switch msg -> Element msg

Render the Switch as an Element msg