TableTextField

fun TableTextField(value: String, onValueChange: (String) -> Unit, modifier: Modifier = Modifier, enabled: Boolean = true, readOnly: Boolean = false, textStyle: TextStyle = LocalTextStyle.current, label: @Composable () -> Unit? = null, placeholder: @Composable () -> Unit? = null, leadingIcon: @Composable () -> Unit? = null, trailingIcon: @Composable () -> Unit? = null, prefix: @Composable () -> Unit? = null, suffix: @Composable () -> Unit? = null, supportingText: @Composable () -> Unit? = null, isError: Boolean = false, visualTransformation: VisualTransformation = VisualTransformation.None, keyboardOptions: KeyboardOptions = KeyboardOptions.Default, keyboardActions: KeyboardActions = KeyboardActions.Default, singleLine: Boolean = false, maxLines: Int = if (singleLine) 1 else Int.MAX_VALUE, minLines: Int = 1, interactionSource: MutableInteractionSource = remember { MutableInteractionSource() }, shape: Shape = OutlinedTextFieldDefaults.shape, colors: TextFieldColors = OutlinedTextFieldDefaults.colors(), contentPadding: PaddingValues = TableTextFieldDefaults.contentPadding(), showBorder: Boolean = true)

Custom text field with configurable content padding. Uses BasicTextField with OutlinedTextFieldDefaults.DecorationBox under the hood.

Parameters

value

the input text to be shown in the text field

onValueChange

the callback that is triggered when the input service updates the text

modifier

the Modifier to be applied to this text field

enabled

controls the enabled state of this text field

readOnly

controls the editable state of the text field

textStyle

the style to be applied to the input text

label

the optional label to be displayed inside the text field container

placeholder

the optional placeholder to be displayed when the text field is in focus and the input text is empty

leadingIcon

the optional leading icon to be displayed at the beginning of the text field container

trailingIcon

the optional trailing icon to be displayed at the end of the text field container

prefix

the optional prefix to be displayed before the input text in the text field

suffix

the optional suffix to be displayed after the input text in the text field

supportingText

the optional supporting text to be displayed below the text field

isError

indicates if the text field's current value is in error state

visualTransformation

transforms the visual representation of the input value

keyboardOptions

software keyboard options that contains configuration

keyboardActions

when the input service emits an IME action, the corresponding callback is called

singleLine

when true, this text field becomes a single horizontally scrolling text field

maxLines

the maximum height in terms of maximum number of visible lines

minLines

the minimum height in terms of minimum number of visible lines

interactionSource

the MutableInteractionSource representing the stream of interactions for this text field

shape

defines the shape of this text field's border

colors

TextFieldColors that will be used to resolve the colors used for this text field in different states

contentPadding

the padding applied to the inner text field. Use TableTextFieldDefaults.contentPadding for standard padding or TableTextFieldDefaults.reducedContentPadding for compact appearance

showBorder

when false, the border/outline of the text field will be hidden