class UIText
A view class that represents a text element.
class UIText extends UIElement;
Notes
- Use the UI.Text() function to create text elements using a builder.
Constructor
new UIText()
Creates a new text view object with the specified text.
Type members
type UIText.IconStyle static
Options for displaying an icon within a text or button control.class TextBuilder static
A builder class for creating UIText instances.
Static members
function textBuilder() static
Creates a view builder for a text element.function badgeBuilder() static
Creates a view builder for a badge element (small pill-shaped label).function iconBuilder() static
Creates a view builder for a standalone icon element (no text).
Instance members
text
The text content to be displayed.icon
The icon to be displayed alongside the text.iconStyle
The style options for displaying the icon.headingLevel
The heading level for semantic HTML output.htmlFormat
True if the text should be rendered as HTML instead of plain text.selectable
True if text selection should be enabled within this element.allowFocus
True if this element may receive input focus.allowKeyboardFocus
True if this element may receive input focus using the keyboard (e.g. Tab key).
Inherited members
name
The identifier for this UI element.hidden
True if the element should be hidden from view.style
The style overrides to apply to this element.setStyle()
Applies additional style overrides to this element.position
The position options for this element.accessibleRole
The WAI-ARIA role for this element, if applicable.accessibleLabel
The WAI-ARIA label text for this element, if applicable.requestFocus()
Requests input focus on this element.requestFocusNext()
Requests input focus for the next sibling element.requestFocusPrevious()
Requests input focus for the previous sibling element.getRenderer() protected
Returns the renderer observer for this element, if any.isFocused()
Returns true if this element currently has input focus.render()
Triggers asynchronous rendering for this element and all contained elements, if any.findViewContent()
Implementation of View.findViewContent(); returns an empty array unless overridden.lastRenderOutput
The last rendered output, if any; set by the UI element renderer.emit()
Emits an event, immediately calling all event handlers.emitChange()
Emits a change event.listen()
Adds a handler for all events emitted by this object.listenOnce()
Returns a promise for a single event with the provided name.listenAsync()
Adds a handler for all events emitted by this object, and returns an async iterable.observe()
Observes a property, a bound property from an attached parent, or an observable object.observeAsync()
Observes one or more targets asynchronously, batching or debouncing/throttling updates.attach() protected
Attaches the specified observable object to this object.isUnlinked()
Returns true if the object has been unlinked.unlink()
Unlinks this observable object.beforeUnlink() protected
A method that’s called immediately before unlinking an object, can be overridden.
