KTextarea

fun KTextarea(value: String, onValueChange: (String) -> Unit, modifier: Modifier = Modifier, placeholder: String = "", enabled: Boolean = true, isError: Boolean = false, minLines: Int = 2, maxLines: Int = Int.MAX_VALUE, keyboardOptions: KeyboardOptions = KeyboardOptions( keyboardType = KeyboardType.Text, imeAction = ImeAction.Default ), keyboardActions: KeyboardActions = KeyboardActions.Default)(source)

Shadcn/ui-style Textarea — mirrors textarea.tsx.

A multi-line text input component designed for longer entries like messages or descriptions. It provides a consistent look and feel with other Kindling input components and handles error states, disabled states, and placeholder text.

Respects androidx.compose.ui.platform.LocalLayoutDirection for RTL text alignment automatically.

Example usage:

var message by remember { mutableStateOf("") }
KTextarea(
value = message,
onValueChange = { message = it },
placeholder = "Type your message here...",
minLines = 3
)

Parameters

value

The current text value to display in the textarea.

onValueChange

Callback invoked when the text value changes.

modifier

The modifier to be applied to the layout.

placeholder

The placeholder text to display when the textarea is empty.

enabled

Whether the textarea is enabled for user interaction.

isError

Whether the textarea should display an error state.

minLines

The minimum number of lines to display.

maxLines

The maximum number of lines to display.

keyboardOptions

Software keyboard options.

keyboardActions

Software keyboard actions.