Skip to content
🌏 Translated with the assistance of DeepSeek and ChatGPT

PromptSend ​

The send entry of Prompt: a send button while idle, a stop entry while loading and cancellable, and a loading state while loading but not cancellable. It reads disabled, loading and cancellable from Prompt, and it also works on its own.

Basic Usage ​

Place PromptSend in the send slot of Prompt to replace the internal send entry; disabled, loading and cancellable follow the Prompt automatically, so you rarely pass them yourself. The scope of the send slot is PromptSendScope, whose submit and cancel are the methods the click is wired to.

Used on its own, pass disabled and loading yourself: loading shows the loading state, and the click is not emitted while disabled or loading.

Click send, then click the stop entry while loading
Hide source code

API ​

PromptSendScope is the scope Prompt passes to the send, start and end slots: submit and cancel submit and abort the input, while disabled, loading and cancellable carry the current state of Prompt.

PromptSendProps ​

AttributeTypeOptionalDefaultDescriptionVersion
disabledbooleanTruefalseWhether PromptSend is disabled.0.2.1
loadingbooleanTruefalseWhether PromptSend is loading.0.2.1

PromptSendEvents ​

EventParameterDescriptionVersion
clicke: MouseEventTriggered when the send entry is clicked.0.2.1

PromptSendSlots ​

SlotParameterDescriptionVersion
triggersend: (e: MouseEvent) => void, disabled: boolean, loading: boolean, cancellable: booleanThe send entry area, replacing the internal button.0.2.1
iconloading: boolean, cancellable: booleanThe icon of the send entry.0.2.1

PromptSendScope ​

AttributeTypeOptionalDefaultDescriptionVersion
cancel(e?: MouseEvent) => voidFalseDiscards the current input.0.2.1
submit(e?: KeyboardEvent | MouseEvent) => voidFalseSubmits the current input.0.2.1
disabledbooleanFalseWhether Prompt is disabled.0.2.1
loadingbooleanFalseWhether Prompt is submitting.0.2.1
cancellablebooleanFalseWhether the submission can be aborted while Prompt is loading.0.2.1