This module allows you to create Bootstrap styled radios.
Create a single radio input with customized Bootstrap styling.
Radio.custom
[ Radio.id "myCustomRadio"
, Radio.checked True
, Radio.onClick MyRadioMsg
]Opaque composable type representing a Radio.
Set the id for the radio. Will automatically set the for attribute for the label
NOTE: You have to use this for custom checkboxes.
Option to toggle the radio checked property on off.
Option to set the name of a radio.
A single radio doesn't make much sense, typically you would have several. To automatically unselect one radio, when selecting another you need to have the same name for each radio in a group.
Use this option to display radios inline.
Shorthand for assigning an onClick handler for a radio.
Option to disable the radio
Use this function to handle any Html.Attribute option you wish for your radio
Opaque type representing valid customization options for a radio
Option to color a radio with success.
Option to color a radio with danger.
In most cases you would probably create multiple radios as a group. This function is a convenient helper to create a list of radios
-- You might have defined a single message for all your radios like this
type Msg
= MyRadioMsg MyRadio Bool
type MyRadio
= Radio1
| Radio2
| Radio3
-- In some view function your could create a radio list as follows
Radio.radioList "myradios"
[ Radio.create
[ Radio.id "myRadio1", Radio.onCheck (MyRadioMsg MyRadio1) ]
"Radio 1"
, Radio.create
[ Radio.id "myRadio2", Radio.onCheck (MyRadioMsg MyRadio2) ]
"Radio 2"
, Radio.create
[ Radio.id "myRadio3", Radio.onCheck (MyRadioMsg MyRadio3) ]
"Radio 3"
]groupName - Name of the radios, all radios will get the same nameradios - List of radios.Create a composable custom radio for use in a radioList
Opaque composable type representing a Radio.
Create a single radio input.