PaackEng/paack-ui/3.1.0

NOTE: the latest version is 7.23.0

UI.Checkbox

Accessible and uniform-styled implementation of a checkbox.

Checkbox.checkbox "I agree with terms of service."
    Msg.ToggleThis
    True
    |> Checkbox.withLabelVisible False
    |> Checkbox.renderElement renderConfig

Building

type Checkbox msg

The Checkbox msg type is used for describing the component for later rendering.

checkbox : String -> (Bool -> msg) -> Bool -> Checkbox msg

Defines all the required properties for creating a checkbox.

checkbox "Buy Milk"
    (Msg.ProductListSet Milk)
    True

Label

withLabelVisible : Bool -> Checkbox msg -> Checkbox msg

Show or hide the checkbox's label.

TextField.setLabelVisible True someTextField

Rendering

renderElement : RenderConfig -> Checkbox msg -> Element msg

End of the builder's life. The result of this function is a ready-to-insert Elm UI's Element.