class TextBuilder
A builder class for creating UIText instances.
class TextBuilder extends UIElement.ElementBuilder<UIText>;
Notes
- Returned by the UI.Text() function.
Instance members
initializer readonly
The initializer used to create each text element instance.text()
Sets the text content.fmt()
Sets localizable or dynamic text.icon()
Sets the icon to display alongside the text.center()
Sets the text alignment to center.larger()
Applies a larger font size (as determined by the renderer or theme).smaller()
Applies a smaller font size (as determined by the renderer or theme).wrap()
Enables or disables text wrapping.headingLevel()
Sets the heading level for semantic HTML output.html()
Sets the text content to be interpreted as HTML.selectable()
Makes the text selectable by the user.allowFocus()
Allows the text element to receive input focus.allowKeyboardFocus()
Allows the text element to receive input focus via the keyboard.
Inherited members
build()
Creates a new instance of the UI element.apply()
Applies a view builder function, returning its result.extend()
Extends this builder with custom methods, returning a new builder object.name()
Sets the element name, which can be used to identify the element in the view hierarchy.accessibleRole()
Sets the WAI-ARIA role for accessibility.accessibleLabel()
Sets the WAI-ARIA label for accessibility.hideWhen()
Hides the element when a specified condition is true.hideUnless()
Hides the element unless a specified condition is true.position()
Sets the position of the element within its parent.size()
Sets both the width and height of the element.width()
Sets the outer, minimum, and/or maximum width of the element.minWidth()
Sets the minimum width of the element.maxWidth()
Sets the maximum width of the element.height()
Sets the outer, minimum, and/or maximum height of the element.minHeight()
Sets the minimum height of the element.maxHeight()
Sets the maximum height of the element.flex()
Enables flex-grow on the element, allowing it to take up as much space as possible (or flex-shrink to allow it to shrink).padding()
Sets the padding around the element.margin()
Sets the margin around the element.textColor()
Sets the text color.fg()
Alias for textColor; sets the text color.background()
Sets the background color or gradient.bg()
Alias for background; sets the background color or gradient.border()
Sets the border properties of the element.borderRadius()
Sets the radius of the border corners.dropShadow()
Adds a drop shadow effect.opacity()
Sets the opacity of the element.dim()
Dims the element by reducing its opacity.cursor()
Sets the mouse cursor style when hovering over the element.fontFamily()
Sets the font family.fontSize()
Sets the font size.fontWeight()
Sets the font weight.bold()
Makes the text bold.italic()
Makes the text italic.underline()
Adds an underline to the text.lineHeight()
Sets the line height.textAlign()
Sets the text alignment.style()
Applies a set of style overrides.effect()
Applies a render effect to this element.requestFocus()
Requests input focus for this element after it has been rendered.on()
Adds an event handler to all instances of the UI element.onKey()
Adds an event handler forKeyDownevents with the specified key name.onClick()
Handles theClickevent.onDoubleClick()
Handles theDoubleClickevent.onContextMenu()
Handles theContextMenuevent.onPress()
Handles thePressevent.onRelease()
Handles theReleaseevent.onKeyDown()
Handles theKeyDownevent.onKeyUp()
Handles theKeyUpevent.onFocusIn()
Handles theFocusInevent.onFocusOut()
Handles theFocusOutevent.onChange()
Handles theChangeevent.onInput()
Handles theInputevent.onBeforeRender()
Handles theBeforeRenderevent, emitted before the element is rendered for the first time.onRendered()
Handles theRenderedevent, emitted when the element has been rendered.
Related
class UIText
A view class that represents a text element.
