InputField

fun InputField(value: String, onValueChange: (String) -> Unit, modifier: Modifier = Modifier, enabled: Boolean = true, maxLines: Int = Int.MAX_VALUE, border: BorderStroke = BorderStroke(1.dp, ChatTheme.colors.borders), innerPadding: PaddingValues = PaddingValues(horizontal = 16.dp, vertical = 8.dp), keyboardOptions: KeyboardOptions = KeyboardOptions(capitalization = KeyboardCapitalization.Sentences), decorationBox: @Composable (innerTextField: @Composable () -> Unit) -> Unit)

Custom input field that we use for our UI. It's fairly simple - shows a basic input with clipped corners and a border stroke, with some extra padding on each side.

Within it, we allow for custom decoration, so that the user can define what the input field looks like when filled with content.

Parameters

value

The current input value.

onValueChange

Handler when the value changes as the user types.

modifier

Modifier for styling.

enabled

If the Composable is enabled for text input or not.

maxLines

The number of lines that are allowed in the input, no limit by default.

border

The BorderStroke that will appear around the input field.

innerPadding

The padding inside the input field, around the label or input.

keyboardOptions

The KeyboardOptions to be applied to the input.

decorationBox

Composable function that represents the input field decoration as it's filled with content.