TextField

fun UiScope.TextField(state: TextFieldState, enabled: Boolean = true, textStyle: TextStyle = TextStyle.TextField, modifier: Modifier = Modifier.Empty, key: ElementKey<*>? = null)(source)

Emits one 200 by 20 single-line text field.

Receiver

active owner-thread screen scope.

Parameters

state

owner-thread text value observed by the retained field.

enabled

whether focus and editing are accepted.

textStyle

profile-backed glyph style.

modifier

active behavior applied to the field.

key

optional stable sibling identity.

Throws

when the scope or state thread is invalid or no runtime evaluation is active.


fun UiScope.TextField(state: TextFieldState, size: IntSize, enabled: Boolean = true, textStyle: TextStyle = TextStyle.TextField, modifier: Modifier = Modifier.Empty, key: ElementKey<*>? = null)(source)

Emits one explicitly sized single-line text field.

Receiver

active owner-thread screen scope.

Parameters

state

owner-thread text value observed by the retained field.

size

exact logical field extent.

enabled

whether focus and editing are accepted.

textStyle

profile-backed glyph style.

modifier

active behavior applied to the field.

key

optional stable sibling identity.

Throws

when size cannot contain the field or later constraints exclude it.

when the scope or state thread is invalid or no runtime evaluation is active.