Text

Text - A UI component for displaying text content.

This component provides:

  • Text display with customizable styling

  • Support for different text alignments

  • Text overflow handling

  • Support for rich text formatting

  • Responsive text sizing

  • Text selection support

Constructors

Link copied to clipboard
constructor(options: TextOptions)

Properties

Link copied to clipboard
open override val currentStyle: ComponentStyle

Get the current style of this component.

Link copied to clipboard
open override val id: String

Unique identifier for this UI component.

Link copied to clipboard
open override val isEnabled: Boolean

Whether this component is currently enabled.

Link copied to clipboard
open override val isVisible: Boolean

Whether this component is currently visible.

Link copied to clipboard
val text: StateFlow<String>

Functions

Link copied to clipboard
fun appendText(text: String)

Append text to the current content.

Link copied to clipboard
open override fun applyStyle(style: ComponentStyle)

Apply a style to this component.

Link copied to clipboard
fun clearText()

Clear the text content.

Link copied to clipboard
open override fun disable()

Disable this component.

Link copied to clipboard
open override fun dispose()

Dispose of this component and release resources.

Link copied to clipboard
open override fun enable()

Enable this component.

Link copied to clipboard

Get the current text content.

Link copied to clipboard

Get the text metrics (width, height, etc.).

Link copied to clipboard
open override fun hide()

Hide this component.

Link copied to clipboard
fun setAlignment(alignment: TextAlignment)

Set the text alignment.

Link copied to clipboard
fun setFontSize(size: Float)

Set the font size.

Link copied to clipboard

Set the font weight.

Link copied to clipboard
fun setText(text: String)

Set the text content.

Link copied to clipboard
fun setTextColor(color: Color)

Set the text color.

Link copied to clipboard
open override fun show()

Show this component.