Add radio buttons with a declarative, controlled group API. <RadioGroup value={expr} onChange={|v| ...}> wraps multiple <Radio value="...">Label</Radio> items. Selection is mutually exclusive and updates the bound value.
- Standard UX for choosing one of several options.
- Cleaner than wiring multiple
RadioButton calls manually.
- Integrates with forms and settings screens.
Scope
- New tags:
<RadioGroup> and <Radio>.
- Controlled group:
value={expr}, onChange={|v| ...}.
- Optional attributes:
horizontal=bool, enabled, tooltip.
<Radio> attributes: value=...; children as label text/inline content.
Proposed API (sketch)
efx!(ui, r#"
<RadioGroup value={prefs.layout} onChange={|v| prefs.layout = v} horizontal="true">
<Radio value="List">List</Radio>
<Radio value="Grid">Grid</Radio>
<Radio value="Compact">Compact</Radio>
</RadioGroup>
"#);
// Mapping (conceptual):
// For each <Radio>: ui.radio_value(&mut group_value, radio_value, label);
Tasks
Add radio buttons with a declarative, controlled group API.
<RadioGroup value={expr} onChange={|v| ...}>wraps multiple<Radio value="...">Label</Radio>items. Selection is mutually exclusive and updates the bound value.RadioButtoncalls manually.Scope
<RadioGroup>and<Radio>.value={expr},onChange={|v| ...}.horizontal=bool,enabled,tooltip.<Radio>attributes:value=...; children as label text/inline content.Proposed API (sketch)
Tasks
<RadioGroup>/<Radio>and validation (no stray<Radio>outside a group).ui.radio_value(&mut value, item_value, label); emitonChangewhen value changes.horizontal=truearranges items in a row; otherwise column.enabled,tooltipon group and/or items.valueon group or item; nested groups.wasm32-unknown-unknown.