textField

abstract fun textField(state: TextFieldState, size: IntSize, enabled: Boolean, style: TextStyle, modifier: Modifier, key: ElementKey<*>?): Element(source)

Creates one profile-backed text-field element observing state.

Return

an immutable retained-element description that references but does not own state.

Parameters

state

caller-owned owner-thread text state.

size

fixed logical field size.

enabled

whether editing and enabled pixels are active.

style

profile text policy.

modifier

active behavior around the field.

key

optional stable sibling identity.


open fun textField(state: TextFieldState, size: IntSize, enabled: Boolean, style: TextStyle, font: ResourceId, modifier: Modifier, key: ElementKey<*>?): Element(source)

Creates one profile-backed text field with an explicitly selected resource-pack font. The default implementation rejects this capability so existing runtime implementations remain source and binary compatible.

Return

an immutable description referencing but not owning state or live font resources.

Parameters

state

caller-owned owner-thread text state.

size

fixed logical field size.

enabled

whether editing and enabled pixels are active.

style

profile color and shadow policy.

font

structural identifier resolved against the runtime's pinned font resources.

modifier

active behavior around the field.

key

optional stable sibling identity.

Throws

when the runtime has not implemented explicit font selection.


open fun textField(state: TextFieldState, size: IntSize, appearance: TextInputAppearance, enabled: Boolean, style: TextStyle, modifier: Modifier, key: ElementKey<*>?): Element(source)
open fun textField(state: TextFieldState, size: IntSize, appearance: TextInputAppearance, enabled: Boolean, style: TextStyle, font: ResourceId, modifier: Modifier, key: ElementKey<*>?): Element(source)

Creates an editor with an independently resolved frame and editing-decoration appearance. Caller state and font ownership follow the existing editor overload; appearance changes do not reset editing. Default appearance delegates to the legacy overload for compatible third-party runtimes.

Throws

when custom appearance is unavailable in this runtime.