orus-io/elm-orus-ui/1.0.1

Formerly cdevienne/elm-orus-ui. Search finds this package by either name.

OUI.Checkbox

Constructor

new :
{ needOnChangeOrDisabled : ()
, needChecked : ()
}
msg

creates a checkbox. It must get a 'onChange' handler or be 'disabled'.

type Checkbox constraints msg

A Checkbox component

withIcon : Icon -> Checkbox a msg -> Checkbox a msg

Change the check icon used at rendering

withColor : Color -> Checkbox a msg -> Checkbox a msg

Change the checkbox color

Bool
-> Checkbox { a | needChecked : () } msg
-> Checkbox { a | withChecked : () } msg

Set the 'checked' state. It not used, the checkbox is 'undetermined'.

(Bool -> msg)
-> Checkbox { a | needOnChangeOrDisabled : () } msg
-> Checkbox { a | hasAction : () } msg

Set a change handler msg

Checkbox { a | needOnChangeOrDisabled : () } msg
-> Checkbox { a | hasAction : () } msg

disable the checkbox

Internals

getChecked : Checkbox c msg -> Bool

get the 'checked' state

getIcon : Checkbox c msg -> Icon

get the icon

getOnChange : Checkbox c msg -> Maybe (Bool -> msg)

get the on change handler

get the color