supermacro / elm-antd / Ant.Checkbox

Themable checkbox component

Types


type Checkbox msg

Represents a customizeable and themable checkbox

Creating a Checkbox

checkbox : Checkbox msg

Create a checkbox

checkbox model.checked

Customizing a Checkbox

withOnCheck : (Basics.Bool -> msg) -> Checkbox msg -> Checkbox msg

Emit messages from your checkbox.

checkbox model.checked
    |> withOnCheck RememberMeCheckboxToggled

withDisabled : Basics.Bool -> Checkbox msg -> Checkbox msg

Disable the checkbox. This prevents emitting messages.

checkbox model.checked
    |> withDisabled model.disabled

withLabel : String -> Checkbox msg -> Checkbox msg

Add a clickable label to your checkbox.

checkbox model.checked
    |> withLabel "remember me"

Rendering the Checkbox

toHtml : Basics.Bool -> Checkbox msg -> Html msg

Render your checkbox.

checkbox model.checked
    |> withOnCheck RememberMeCheckboxToggled
    |> withLabel "remember me"
    |> toHtml