Controls
Radio buttons, segmented buttons and switches.
Example
Show code
use zeyn::prelude::*;
pub fn overview(_ctx: &Ctx) -> Node {
Form::of(Choices { size: Size::Medium, ..Choices::default() })
.field(Choices::size)
.control(Choices::size, Control::Segmented)
.field(Choices::delivery)
.control(Choices::delivery, Control::Radio)
.field(Choices::gift)
.control(Choices::gift, Control::Switch)
.submit("Save", save_choices)
.on_success(|_, ui| ui.toast("Saved. Nothing was stored."))
.into()
}