text

abstract fun text(text: UiText, style: TextStyle, modifier: Modifier, key: ElementKey<*>?): Element(source)

Creates one profile-backed text element.

Return

an immutable retained-element description owned by the caller.

Parameters

text

unresolved text retained for drawing and semantics.

style

profile color and shadow policy.

modifier

active behavior around the element.

key

optional stable sibling identity.


open fun text(text: UiText, layout: TextLayout, style: TextStyle, modifier: Modifier, key: ElementKey<*>?): Element(source)

Creates one profile-backed text element with an explicit line layout.

The default implementation delegates TextLayout.SingleLine to the existing text method and rejects multiline capability. This keeps existing runtime implementations source and binary compatible without silently ignoring a requested layout.

Return

an immutable retained-element description owned by the caller.

Parameters

text

unresolved text retained for drawing and semantics.

layout

immutable wrapping, line-count, overflow, and line-spacing policy.

style

profile color and shadow policy.

modifier

active behavior around the element.

key

optional stable sibling identity.

Throws

when multiline layout is requested from a runtime that has not implemented it.