Skip to content

PromptInput ​

Conversation composer: auto-growing multiline input, Enter to submit, Shift+Enter for a newline, suggestions, send/stop state, plus prefix/actions/footer slots.

Basic Usage ​

Type a message + suggestions (click to fill; Enter submits)

Loading / Disabled ​

While loading, the host reflects aria-busy="true", the send button becomes "Stop" and dispatches oas-stop; readonly restricts editing but does not block the stop command.

loading: send becomes stop; disabled: input and submit are blocked

Read-only / maxlength / rows / submit policy

Slots ​

prefix / actions / footer slots

AttachmentTemplateEnter to send · Shift+Enter for newline

API ​

oas-prompt-input ​

Attributes ​

AttributeDescriptionTypeDefault
clear-on-submitClear after submit (default true)stringtrue
disabledDisable input and submitboolean—
loadingGenerating; send button becomes stopboolean—
maxlengthMaximum character countstring—
placeholderPlaceholder (defaults to i18n promptInput.placeholder)string—
readonlyRead-only (focus/copy, no edits)boolean—
rowsInitial rows (1+, auto-grow capped at 160px)string1
submit-on-enterEnter submits (default true; false requires the button; Shift+Enter always newlines)stringtrue
suggestionsSuggestions JSON: strings or { label?, value } itemsstring—
valueCurrent text (property channel; attribute is the initial value)string—

Property (JS property; see each row for attribute reflection) ​

PropertyDescriptionTypeDefault
valueCurrent text (read/write)string—

Methods ​

MethodSignatureDescription
submitsubmit(): booleanSubmit current text; returns false for empty/disabled/loading
stopstop(): voidStop generation (dispatches oas-stop only while loading)
focusInputfocusInput(): voidFocus the inner textarea

Events ​

EventDescription
oas-stopDispatched when the stop button is clicked while loading, detail: {}
oas-submitDispatched on submit, detail:
oas-suggestion-selectDispatched when a suggestion is clicked, detail:

Slots ​

NameDescription
actionsActions before the send button
footerFooter/help row
prefixContent before the input

Released under the MIT OR Apache-2.0 License.