PaackEng/paack-ui/7.7.1

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.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

Hide the checkbox's label.

Checkbox.withHiddenLabel someCheckbox

Size

The different sizes the Checkbox can take

Checkbox.withSize changes the size of the Checkbox

Checkbox.withSize Checkbox.sizeMD someCheckbox

Small-sized Checkbox

Medium-sized Checkbox

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.