Skip to content
Version 2.32.0
↓ Get the launcher

SelectableElement record

Makes any Child subtree clickable as a whole and tints its background by interaction state — the rich-row analog of ButtonElement (which only wraps a single label). For list rows that are multi-line / multi-widget (a history session, a recent-lookup entry) where a per-row button would lose the layout. Rest = transparent; hover = faint accent wash; Selected() true (poll-diffed) = a stronger accent fill. A click anywhere on the row fires OnClick. Composes inside a List/Column like any leaf.

public record SelectableElement : IEquatable<HudElement>
name description
SelectableElement(…) Makes any Child subtree clickable as a whole and tints its background by interaction state — the rich-row analog of ButtonElement (which only wraps a single label). For list rows that are multi-line / multi-widget (a history session, a recent-lookup entry) where a per-row button would lose the layout. Rest = transparent; hover = faint accent wash; Selected() true (poll-diffed) = a stronger accent fill. A click anywhere on the row fires OnClick. Composes inside a List/Column like any leaf.
Bare { get; set; } Opt in to a click target with NO visuals of its own: no background tint (rest, hover and selected all stay fully transparent), no padding, and the element HUGS its child instead of filling the row — so wrapping a text in it changes neither the layout nor the look, and only the child’s own rect is clickable. Click, OnHover, OnRightClick, FrontWindowBlocks and the drag-reorder click swallow work as usual; SelectedBar is ignored. Use for a link-styled label whose hover look the plugin draws itself (e.g. a clickable name). Default false = the normal tinted, padded row. Init property, NOT a ctor param (binary-compatible).
Child { get; set; }
OnClick { get; set; }
OnClickWithRect { get; set; } When non-null, invoked on a left click (right after OnClick) with the row’s on-screen rect in screen PIXELS, top-left origin — the same space as OnClickWithRect. Use to anchor a popup to the clicked element instead of the cursor. ⚠️ SetRect takes CANVAS units: multiply by CanvasWidth / ScreenWidth first. Init property, NOT a ctor param (binary-compatible).
OnHover { get; set; } Optional — fires with true when the pointer enters the row and false when it leaves (ticker-driven; never fires in the static sandbox). Use for hover-preview panes. Added as an init property, NOT a ctor param, so the record’s primary constructor stays binary-compatible with existing plugins.
OnRightClick { get; set; } Optional — fires on RIGHT-button-down over the row (ticker-driven, the same hook as OnRightClick; skipped when a window in front covers the pointer). Use to open a context menu. A right-click never fires OnClick, and the left-click path is unchanged. Init property, NOT a ctor param, so the record’s primary constructor stays binary-compatible.
Selected { get; set; }
SelectedBar { get; set; } Opt in to a thin accent underline bar drawn across the row’s BOTTOM edge while Selected() is true — on TOP of the selected-fill tint — to mark an “active tab” in a tab strip (a soft accent pill + an underline indicator). The bar is ~3 px tall, full-width, in the theme menu accent, and is OVERLAID (ignores layout) so it never changes the row’s measured size. Default false: every other SelectableElement (ordinary list rows, grid cells with no Selected state) is drawn exactly as before. Added as an init property, NOT a ctor param, so the record’s primary constructor stays binary-compatible with existing plugins.