ChatComposer

fun ChatComposer(value: String, onValueChange: (String) -> Unit, onSend: () -> Unit, modifier: Modifier = Modifier, sendEnabled: Boolean = true, maxLines: Int = DEFAULT_MAX_LINES, voiceInput: ChatComposerVoiceInput? = null, labels: ChatComposerLabels = ChatComposerLabels())

A chat message field with a send button and optional voice input.

The field grows with its text up to maxLines and then scrolls. The trailing button sends a non-blank draft. With voiceInput, an empty draft shows a microphone instead, which becomes a stop button with a level ring while listening and a spinner while processing; editing pauses during both so the transcript is not overwritten.

Send runs onSend from the button, the keyboard's Send action, or Enter on a hardware keyboard (Shift+Enter inserts a line break). It never runs for a blank draft or while sendEnabled is false, for example while a reply is streaming. The composer never clears value; clear it in onSend. Stopping an active recording is always allowed.