Label is not focusable by default (IsFocusable = false).
Accessibility Methods
Methods inherited from UiElement:
Method
Description
SetAccessibilityLabel(string?)
Sets screen reader label
BindAccessibilityLabel(name, getter)
Binds accessibility label
SetAccessibilityHint(string?)
Sets additional context hint
BindAccessibilityHint(name, getter)
Binds accessibility hint
SetAccessibilityValue(string?)
Sets current value description
BindAccessibilityValue(name, getter)
Binds accessibility value
SetAccessibilityTraits(AccessibilityTrait)
Sets accessibility traits
BindAccessibilityTraits(name, getter)
Binds accessibility traits
AddAccessibilityTraits(AccessibilityTrait)
Adds traits to existing
RemoveAccessibilityTraits(AccessibilityTrait)
Removes specific traits
SetIsAccessibilityElement(bool)
Include in accessibility tree
SetHighContrastBackground(IBackground)
Background for high contrast mode
SetHighContrastBackground(Color)
Solid background for high contrast
SetHighContrastForeground(Color)
Text color for high contrast mode
SetEnforceMinimumTouchTarget(bool)
Enforce 44x44 minimum size
Tooltip Methods
Extension methods available on all UiElement:
Method
Description
SetTooltip(string)
Sets tooltip text
SetTooltip(UiElement)
Sets tooltip with custom content
SetTooltip(Action<TooltipAttachment>)
Configures tooltip via builder
SetTooltipPlacement(TooltipPlacement)
Sets tooltip position
SetTooltipShowDelay(int)
Sets show delay in ms
SetTooltipHideDelay(int)
Sets hide delay in ms
BindTooltipContent(name, getter)
Binds tooltip content
BindTooltipPlacement(name, getter)
Binds tooltip placement
BindTooltipShowDelay(name, getter)
Binds show delay
BindTooltipHideDelay(name, getter)
Binds hide delay
TooltipPlacement Values
Value
Description
TooltipPlacement.Auto
Automatic positioning (default)
TooltipPlacement.Top
Above element
TooltipPlacement.Bottom
Below element
TooltipPlacement.Left
Left of element
TooltipPlacement.Right
Right of element
Context Menu Methods
Extension methods available on all UiElement:
Method
Description
SetContextMenu(ContextMenu)
Sets context menu
SetContextMenu(Action<ContextMenu>)
Configures context menu via builder
SetContextMenuBackground(IBackground)
Sets menu background
SetContextMenuBackground(Color)
Sets menu background color
SetContextMenuHoverBackgroundColor(Color)
Sets hover color
SetContextMenuTextColor(Color)
Sets menu text color
BindContextMenuBackground(name, getter)
Binds menu background
BindContextMenuHoverBackgroundColor(name, getter)
Binds hover color
BindContextMenuTextColor(name, getter)
Binds text color
Other Methods
Method
Description
IgnoreStyling()
Prevents global styles from being applied
SetDebug(bool)
Shows debug bounds (red border)
Examples
Multi-line Label with Wrapping
newLabel().SetText("This is a long text that will wrap to multiple lines when it exceeds the available width.").SetTextWrapping(TextWrapping.WordWrap).SetDesiredWidth(200)
Truncated Label
newLabel().SetText("Very long text that gets truncated").SetTextTruncation(TextTruncation.End).SetDesiredWidth(100)