Expand description
<tabs> strip-button runtime.
The markup-level <tabs bind-value="active"> <tab name="general" label="General">...</tab> ... </tabs> parser pass synthesises one
<button class="tab-btn"> per tab and tags each with a
TabStripButton component. This plugin’s tiny dispatcher
watches ClickEvents, looks up the matching button, and writes
Signals[signal_name] = tab_value - no author-side script
required for the basic “switch active tab” flow.
Structs§
- Dropdown
Button <dropdown>toggle marker attached by the parser to the dropdown header button. Clicks flipSignals[open_signal]between"true"and"false".- Dropdown
Option Button <option>button inside a<dropdown>panel. Click writesSignals[value_signal] = valueand closes the panel by writingSignals[open_signal] = "false".- Dropdown
Option Spec - One
<option>’s metadata mirrored onto the dropdown header (markup order). Carried onDropdownButtonso the closed combobox can run keyboard interaction - Up/Down value stepping and type-ahead - before the panel body (and itsDropdownOptionButtonentities) has ever mounted (<if>bodies spawn lazily on first open). - Menu
Item Button <menu>item marker. Clicks emitMenuClickedwith the item id and close the menu by writing the open signal to"false".- TabButton
Style - Per-tab-button track fills, resolved at spawn from markup / CSS.
sync_tab_button_visualsswapsVisuals::fillbetween the two as theSelectedmarker is added to / removed from the button - same pattern as [crate::controls::ToggleStyle] /crate::controls::sync_toggle_visualsfor<toggle>. - TabStrip
Button - Strip-button marker.
(signal_name, tab_value)- clicking writesSignals[signal_name] = tab_value. Authored only by the<tabs>parser pass; not exposed to markup directly. - Tabs
Plugin - Plugin: registers the click dispatcher in
TickStage::Systemsafterlumen-input’sdispatch_clicksso we observe the same frame’s clicks.
Constants§
- TAB_
SELECTED_ BG - Default fill for a
.tab-btn:selectedwhen no author / skin:selected { bg: ... }rule matched. Mirrors the default skin’s--lumen-accent(#33c7ce) so a bare<tabs>with no CSS still shows which tab is active.
Functions§
- apply_
a11y_ expand_ to_ dropdown - Mirrors
A11yState::EXPANDEDonto the dropdown’s open-state signal whenever the bit changes. - dispatch_
dropdown_ clicks <dropdown>click dispatcher. Toggles the open-panel signal on header clicks; writes the selected value and closes the panel on option clicks.- dispatch_
menu_ item_ clicks <menu>item click dispatcher. EmitsMenuClickedand closes the menu panel in the same tick.- dispatch_
tab_ keys - Keyboard navigation for tab strips, scoped to children of a tab
list (i.e. siblings of the focused
TabStripButton). Matches theQTabBarkeyboard contract: - sync_
tab_ button_ visuals - Keep a tab-strip button’s visuals in step with whether it currently
carries
Selected: swapVisuals::fillbetweenTabButtonStyle::selected_bg/TabButtonStyle::unselected_bg. The fill is held inStyleOverridesunder the hover and press tints, so a tint releases onto the current state colour rather than a stale one - mirrorscrate::controls::sync_track_fill. - sync_
tab_ selected - Maintain the
Selectedmarker across every tab strip: the button whosevaluematches its bound signal’s current value carries it; all its siblings shed it. Idempotent per tick - insert / remove only fire on actual transitions, so archetypes stay put on idle frames.