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.
import Material.Radio as Radio
type Msg
= Changed
main =
Radio.radio
(Radio.config
|> Radio.setChecked True
|> Radio.setOnChange Changed
)Specify a message when the user changes a radio
Specify whether a radio button is checked
Specify whether a radio button is disabled
Disabled radio buttons cannot be interacted with and have no visual interaction effect.
Specify additional attributes
To make a radio button display its checked state, set its setChecked
configuration option to True.
Radio.radio (Radio.config |> Radio.setChecked True)To disable a radio button, set its setDisabled configuration option to True.
Disabled radio buttons cannot be interacted with and have no visual interaction effect.
Radio.radio (Radio.config |> Radio.setDisabled True)
Radio button configuration