When to use it
The host owns the text and clears it after submit. Send is disabled until the trimmed prompt fits maxLength; Stop appears only while pending.
Native example
The host owns the text and clears it after submit. Send is disabled until the trimmed prompt fits maxLength; Stop appears only while pending.
import androidx.compose.runtime.*
import com.santi020k.lumen.*
@Composable
fun AskExample(send: (String) -> Unit, cancel: () -> Unit) {
var prompt by remember { mutableStateOf("") }
var pending by remember { mutableStateOf(false) }
LumenPromptComposer(
value = prompt,
onValueChange = { prompt = it },
onSubmit = { text -> send(text); prompt = ""; pending = true },
label = "Ask Lumen",
pending = pending,
onStop = { cancel(); pending = false },
actions = {
LumenIconButton(
name = LumenIconName.Paperclip,
contentDescription = "Attach a file",
onClick = {},
size = LumenControlSize.Sm
)
}
)
}Reference
The primary shared and platform-specific options exposed by LumenPromptComposer.
| API | Values or type | Default | Description |
|---|---|---|---|
| value / maxLength / pending | controlled text / character limit / show stop | required / 4000 / false | The host owns the text and clears it after submit. |
Native behavior
The host owns the text and clears it after submit. Send is disabled until the trimmed prompt fits maxLength; Stop appears only while pending.
Visible label, named send and stop buttons, busy while pending.
Shared component