primait / pyxis-components / Prima.Pyxis.Form.Checkbox

Configuration


type Checkbox model msg

Represent the opaque Checkbox configuration.


type alias CheckboxChoice =
{ value : String
, label : String 
}

Represent a choice for the Checkbox.

Configuration Methods

checkbox : (model -> List String) -> (String -> msg) -> List CheckboxChoice -> Checkbox model msg

Create a checkbox.

checkboxChoice : String -> String -> CheckboxChoice

Creates a choice for the Checkbox.

Rendering

render : model -> Checkbox model msg -> List (Html msg)

Renders the Checkbox.

Options

withAttribute : Html.Attribute msg -> Checkbox model msg -> Checkbox model msg

Adds a generic Html.Attribute to the Checkbox.

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

Adds a disabled Html.Attribute to the Checkbox.

withClass : String -> Checkbox model msg -> Checkbox model msg

Adds a class to the Checkbox.

withId : String -> Checkbox model msg -> Checkbox model msg

Adds an id Html.Attribute to the Checkbox.

withName : String -> Checkbox model msg -> Checkbox model msg

Adds a name Html.Attribute to the Checkbox.

Event Options

withOnFocus : msg -> Checkbox model msg -> Checkbox model msg

Attaches the onFocus event to the Checkbox.

withOnBlur : msg -> Checkbox model msg -> Checkbox model msg

Attaches the onBlur event to the Checkbox.

Validation

withValidation : (model -> Maybe Prima.Pyxis.Form.Validation.Type) -> Checkbox model msg -> Checkbox model msg

Adds a Validation rule to the Checkbox.