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
TextRange- Represents cursor position or text selection rangeTextFieldBuffer- Mutable buffer for editing text with change trackingTextFieldState- Observable state holder for text field contentTextFieldLineLimits- Controls single-line vs multi-line input
§Example
let state = TextFieldState::new("Hello");
state.edit(|buffer| {
buffer.place_cursor_at_end();
buffer.insert(", World!");
});
assert_eq!(state.text(), "Hello, World!");Structs§
- Text
Field Buffer - A mutable text buffer that can be edited.
- Text
Field State - Observable state holder for text field content.
- Text
Field Value - Immutable snapshot of text field content.
- Text
Range - Represents a range in text, used for cursor position and selection.
Enums§
- Text
Field Line Limits - Line limit configuration for text fields.
Functions§
- filter_
for_ single_ line - Filters text for single-line mode by replacing newlines with spaces.