Radio buttons allow the user to select one option from a set while seeing all available options.
Note that radio buttons are usually used in conjunction with form fields. Refer to FormField for more information.
import Material.Radio exposing (radio, radioConfig)
type Msg
= RadioClicked
main =
radio
{ radioConfig
| checked = True
, onClick = Just RadioClicked
}Default radio button configuration
Radio button configuration
To set the state of a radio button, set its checked configuration field to a Bool value.
radio { radioConfig | checked = False }To disable a radio button, set its disabled configuration field to True. Disabled radio buttons cannot be interacted with and have no visual interaction effect.
radio { radioConfig | disabed = True }
Radio button view function