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.