StylishEditable

fun StylishEditable(value: String, onValueChange: (String) -> Unit, modifier: Modifier = Modifier, enabled: Boolean = true, onCommit: (String) -> Unit? = null, textStyle: TextStyle = MaterialTheme.typography.bodyLarge, editShape: Shape = RoundedCornerShape(DefaultStylishDimensions.connectedCornerRadius), singleLine: Boolean = true)

An inline-editable text row — the web "Editable" pattern from Chakra UI.

Displays value as static text with a small edit affordance. Tapping switches to an input field; confirm (check) commits via onCommit and onValueChange, cancel (close) discards the edit. The field is committed when the keyboard's done action is pressed.

Parameters

value

The current text.

onValueChange

Called as the user types.

modifier

Modifier applied to the root row.

enabled

When false, editing is not possible.

onCommit

Optional callback invoked with the final text when an edit is committed. When null, only onValueChange is called.

textStyle

Typography of both the display text and the input. Defaults to MaterialTheme.typography.bodyLarge.

editShape

Corner shape of the input field. Defaults to RoundedCornerShape with DefaultStylishDimensions.connectedCornerRadius.

singleLine

Whether the value is a single line. When true, the IME done action commits the edit. Defaults to true.