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.
Apple availability
Import LumenUI in the target that uses this component. iPad support follows the iOS package baseline and uses native iPad layout behavior.
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 LumenUI
import SwiftUI
struct ComposerExample: View {
@State private var draft = ""
@State private var pending = false
var body: some View {
LumenPromptComposer(text: $draft, pending: pending, submitOnEnter: true, onSubmit: { prompt in
print("Send", prompt)
draft = ""
pending = true
}, onStop: {
pending = false
})
}
}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