Skip to content

TextFieldValue

@Immutable



data class TextFieldValue(
    val text: String = "", 
    val selection: TextRange = TextRange(text.length), 
    val composition: TextRange? = null
)

Immutable value holder for a net.kernelpanicsoft.archie.gui.composables.input.textfield.TextField or BasicTextField.

Contains the full text, the current selection (or cursor position), and an optional IME composition range. Pass new instances to onValueChange to update the field.

Constructors

TextFieldValue

constructor(
    text: String = "", 
    selection: TextRange = TextRange(text.length), 
    composition: TextRange? = null
)

Properties

composition

selectedText

The characters currently selected by the user (empty string when the selection is collapsed).

selection

text

val text: String

Functions

toString

open override fun toString(): String