Skip to main content

Module text

Module text 

Source
Expand description

Text input module for editable text fields.

This module provides the core types for text editing, following Jetpack Compose’s text input architecture from compose/foundation/foundation/src/commonMain/kotlin/androidx/compose/foundation/text/input/.

§Core Types

§Example

let state = TextFieldState::new("Hello");
state.edit(|buffer| {
    buffer.place_cursor_at_end();
    buffer.insert(", World!");
});
assert_eq!(state.text(), "Hello, World!");

Structs§

TextFieldBuffer
A mutable text buffer that can be edited.
TextFieldState
Observable state holder for text field content.
TextFieldValue
Immutable snapshot of text field content.
TextRange
Represents a range in text, used for cursor position and selection.

Enums§

TextFieldLineLimits
Line limit configuration for text fields.

Functions§

filter_for_single_line
Filters text for single-line mode by replacing newlines with spaces.