Jenga Text Area
A multi-line text box for comments, notes, reasons and descriptions. It starts minLines tall, grows up to maxLines as the user types, then scrolls inside itself. Text and placeholder start at the top. The Enter key adds a new line unless keyboardOptions sets an IME action.
With a maxLength, a counter ("120 / 512") sits under the box on the right; typing stops at the limit, pasted text is cut to it, and the counter turns to the error color once the limit is reached.
Parameters
the current text.
called when the text changes.
the Modifier for the whole field (label + box + support).
optional label shown above the box.
optional hint shown when value is empty.
validation status; see JengaTextFieldStatus.
optional helper/error text shown below the box.
the most characters allowed; null means no limit and no counter.
whether the box is editable.
whether the box is read-only (focusable but not editable).
lines shown before anything is typed.
lines shown before the text scrolls inside the box.
software-keyboard configuration.
IME action handlers.
the box shape; defaults to JengaTextFieldDefaults.shape.
the color set; defaults to JengaTextFieldDefaults.colors.
the input and placeholder text style.
padding inside the box.
width of the soft focus halo; 0.dp removes it.
Samples
var notes by remember {
mutableStateOf(
value = "",
)
}
JengaTextArea(
value = notes,
onValueChange = { notes = it },
label = "Visit notes",
placeholder = "What happened on the visit?",
maxLength = 512,
)