KInput

fun KInput(value: String, onValueChange: (String) -> Unit, modifier: Modifier = Modifier, placeholder: String = "", enabled: Boolean = true, isPassword: Boolean = false, isError: Boolean = false, singleLine: Boolean = true, maxLines: Int = if (singleLine) 1 else Int.MAX_VALUE, minLines: Int = 1, leadingIcon: @Composable () -> Unit? = null, trailingIcon: @Composable () -> Unit? = null, keyboardOptions: KeyboardOptions = KeyboardOptions.Default.copy( keyboardType = if (isPassword) KeyboardType.Password else KeyboardType.Text ), keyboardActions: KeyboardActions = KeyboardActions.Default, interactionSource: MutableInteractionSource = remember { MutableInteractionSource() })(source)

Shadcn/ui-style Input — mirrors input.tsx.

A standardized text input component that follows the Kindling design system. It provides built-in support for placeholders, error states, disabled states, and password masking.

Respects androidx.compose.ui.platform.LocalLayoutDirection via Compose RTL support.

Example usage:

var email by remember { mutableStateOf("") }

KInput(
value = email,
onValueChange = { email = it },
placeholder = "name@example.com",
leadingIcon = { Icon(Icons.Default.Email, null) }
)

Parameters

value

The current text value to display.

onValueChange

Callback invoked when the text value changes.

modifier

The modifier to be applied to the input layout.

placeholder

The placeholder text to display when the input is empty.

enabled

Whether the input is enabled for interaction.

isPassword

Whether the input should mask the text (e.g., for passwords).

isError

Whether the input should display an error state.

singleLine

Whether the input should be restricted to a single line.

maxLines

The maximum number of lines allowed.

minLines

The minimum number of lines allowed.

leadingIcon

Optional leading composable slot.

trailingIcon

Optional trailing composable slot.

keyboardOptions

Software keyboard options.

keyboardActions

Software keyboard actions.

interactionSource

The MutableInteractionSource to represent the stream of interactions.