Expand description
<radio> behavior: name-grouped exclusive selection with roving
tab index and wrapping arrow-key navigation (Qt QRadioButton in
an auto-exclusive group / WAI-ARIA radiogroup).
The markup parser desugars <radio group="g" value="v" label="...">
into a row (tag radio, carrying RadioButton) with a
.radio-dot tile child (RadioDot) and a .radio-label label,
so every visual is CSS-reachable:
.radio-dot { width: 18; height: 18; radius: 9; bg: ...; border: ...; }
radio:selected { bg: var(--lumen-accent); } /* dot fill when on */
radio:focus { outline: 2 var(--lumen-accent); }Contract:
- The GROUP is the set of
<radio>elements sharing agroupstring; the group’s selected value lives in thePropertyStoreglobal of that name (bindable / script-readable like any signal). - Exactly one selected per group:
sync_radio_selectedseeds the first enabled member when the signal is unset. - Click (row, dot, or label) and Space select. Arrow keys move selection to the next / previous enabled member, wrapping at the ends and skipping disabled members (web radiogroup behavior; selection follows focus, as in Qt/GTK).
- Roving tabindex: only the selected (else first enabled) member is
in the Tab chain, so Tab enters and leaves the GROUP, not each
item (
sync_radio_tab_index).
Structs§
- Radio
Button - One member of a radio group.
- Radio
Dot - Marker on the
.radio-dotchild tile. Its selected fill is held inStyleOverridesover the dot’s own. - Radio
Plugin - Plugin: registers selection dispatch, marker/visual sync, roving tab index, and arrow-key navigation.
- Radio
Style - Per-radio fill for the selected dot state, resolved at spawn from
radio:selected { bg: ... }(routed throughAttributes::selected_bg) with the accent fallback.
Functions§
- dispatch_
radio_ clicks - Click / Space (via the focused-key
ClickEventpath) on a radio - or any of its children - writes the member’s value to the group signal AND moves focus to the radio root (Qt: clicking a radio focuses it, so arrow-key navigation picks up right where the pointer left off). Focus is set here as well as on the press because a click raised without one, from the keyboard or a script, still moves it. - radio_
group_ keys - Arrow keys while a radio holds focus: move selection to the next /
previous enabled group member, WRAPPING at the ends (web
radiogroup; unlike tabs, which clamp). Selection follows focus -
the newly focused member is selected immediately (Qt/GTK). Also
moves the
Focused+FocusVisiblemarkers and the tracker. - sync_
radio_ selected - Mirror each group’s signal onto the
Selectedmarker, and enforce exactly-one-selected: a group whose signal is unset (or empty) gets its first enabled member (markup order) selected and the signal seeded. - sync_
radio_ tab_ index - Roving tabindex: exactly one member per group sits in the Tab chain:
the selected member, else the first enabled one. Everyone else
holds
TabIndex(-1), whichcycle_focus_on_tabskips, so Tab jumps over the group as a unit in both directions. - sync_
radio_ visuals - Keep every
.radio-dotchild in step with its parent’sSelectedmarker:selected_bgwhile selected, the dot’s own fill otherwise.