A radio button.
Radios that belong together are one choice: the app keeps which is chosen and gives checked to each.
Signature
pub const fn radio<M>(text: &str, checked: bool) -> Radio<'_, M>Methods
.on_select(message: M) -> Self— Sendsmessagewhen it is chosen.
Example
use fusuma::{column, radio};
let chosen = 1;
let view = column((
radio("Small", chosen == 0).on_select(0),
radio("Medium", chosen == 1).on_select(1),
radio("Large", chosen == 2).on_select(2),
));
let built = fusuma::doc::built::<i32, _>(&view);
assert_eq!(built.texts(), ["Small", "Medium", "Large"]);