Represents the configuration choice for the Radio
.
{ value : String
, label : String
}
Represents a choice for the Radio
.
radio : (model -> Maybe String) -> (String -> msg) -> List RadioChoice -> Radio model msg
Creates the Radio
.
radioChoice : String -> String -> RadioChoice
Creates a choice for the Radio
.
render : model -> Radio model msg -> List (Html msg)
Renders the Radio config
.
import Prima.Pyxis.Form.Radio as Radio
view : List (Html Msg)
view =
[ radioChoice "option_1" "Option 1"
, radioChoice "option_2" "Option 2"
]
|> Radio.radio
|> Radio.render
withAttribute : Html.Attribute msg -> Radio model msg -> Radio model msg
Sets an attribute
to the Radio config
.
withClass : String -> Radio model msg -> Radio model msg
Sets a class
to the Radio config
.
withDisabled : Basics.Bool -> Radio model msg -> Radio model msg
Sets a disabled
to the Radio config
.
withId : String -> Radio model msg -> Radio model msg
Sets an id
to the Radio config
.
withName : String -> Radio model msg -> Radio model msg
Sets a name
to the Radio config
.
withOnBlur : msg -> Radio model msg -> Radio model msg
Sets an onBlur event
to the Radio config
.
withOnFocus : msg -> Radio model msg -> Radio model msg
Sets an onFocus event
to the Radio config
.
withValidation : (model -> Maybe Prima.Pyxis.Form.Validation.Type) -> Radio model msg -> Radio model msg
Adds a validation rule to the Radio
.