StylishOutlinedTextField

fun StylishOutlinedTextField(value: String, onValueChange: (String) -> Unit, modifier: Modifier = Modifier, label: @Composable () -> Unit? = null, placeholder: @Composable () -> Unit? = null, leadingIcon: @Composable () -> Unit? = null, trailingIcon: @Composable () -> Unit? = null, supportingText: @Composable () -> Unit? = null, isError: Boolean = false, enabled: Boolean = true, readOnly: Boolean = false, singleLine: Boolean = true, maxLines: Int = if (singleLine) 1 else Int.MAX_VALUE, minLines: Int = 1, keyboardOptions: KeyboardOptions = KeyboardOptions.Default, keyboardActions: KeyboardActions = KeyboardActions.Default, visualTransformation: VisualTransformation = VisualTransformation.None, shape: Shape = StylishTheme.shapes.medium, colors: TextFieldColors = StylishOutlinedTextFieldDefaults.colors(), interactionSource: MutableInteractionSource? = null)

An outlined text field with Stylish styling, designed for form input with built-in label, placeholder, and supporting text support. Wraps Material's OutlinedTextField with Stylish theme integration.

The outlined variant displays a transparent container with a border outline, making it suitable for forms where you want a lighter visual weight compared to filled text fields. The border animates and changes color on focus, error, and disabled states.

When minLines is 1 and maxLines is 1 (the default), the field operates in single-line mode. Setting minLines greater than 1 switches to a multiline field whose maxLines defaults to Int.MAX_VALUE. When singleLine is true, both minLines and maxLines are forced to 1 (matching Material's single-line contract).

Error display: when isError is true, the field renders its error indicator color on the border. The supportingText slot can be used to display error messages or helper text below the field.

Parameters

value

Current text value (controlled state).

onValueChange

Called with the updated text on every edit.

modifier

Modifier applied to the enclosing Column root.

label

Optional label displayed above the field. Animates to float above the container when the field is focused or has content.

placeholder

Optional hint text shown when the field is empty and not focused.

leadingIcon

Optional icon slot at the start of the field.

trailingIcon

Optional icon slot at the end of the field.

supportingText

Optional slot rendered below the field. Use this for helper text, error messages, or character counters.

isError

When true, the field renders its error indicator color on the border. Defaults to false.

enabled

When false, the field rejects input and renders in Material's disabled color scheme. Defaults to true.

readOnly

When true, the field displays its text without allowing edits. Defaults to false.

singleLine

When true, forces single-line mode: minLines and maxLines are set to 1 and the field scrolls horizontally instead of wrapping. When false (default), single-line mode is derived from minLines and maxLines.

maxLines

Maximum lines before scrolling. Defaults to 1 when singleLine is true, otherwise Int.MAX_VALUE. Ignored when singleLine is true.

minLines

Minimum visible lines. Defaults to 1. Ignored when singleLine is true.

keyboardOptions

Software keyboard options (keyboard type, capitalization, IME action) for the field.

keyboardActions

Software keyboard action handlers for the field.

visualTransformation

Visual transformation applied to the input text (e.g. password masking). Defaults to VisualTransformation.None.

shape

Shape of the field container and border. Defaults to RoundedCornerShape with StylishTheme.shapes.medium.

colors

Color scheme for the field. Defaults to StylishOutlinedTextFieldDefaults.colors.

interactionSource

The MutableInteractionSource for the field, used to observe focus/press/hover interactions. When null, an internal one is remembered.

See also