PaackEng / paack-ui / 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 -> (Basics.Bool -> msg) -> Basics.Bool -> Checkbox msg

Defines all the required properties for creating a checkbox.

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

Label

withHiddenLabel : Checkbox msg -> Checkbox msg

Hide the checkbox's label.

Checkbox.withHiddenLabel someCheckbox

Size


type CheckboxSize

The different sizes the Checkbox can take

withSize : CheckboxSize -> Checkbox msg -> Checkbox msg

Checkbox.withSize changes the size of the Checkbox

Checkbox.withSize Checkbox.sizeMD someCheckbox

sizeSM : CheckboxSize

Small-sized Checkbox

sizeMD : CheckboxSize

Medium-sized Checkbox

Rendering

renderElement : UI.RenderConfig.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.