Skip to content

AiEditorSender Panel Input

AiEditorSender is a powerful AI conversation input component inspired by Element Plus X EditorSender. It integrates attachment display, toolbars, and custom slots, making it suitable for complex AI interaction scenarios.

Basic Usage

Included default input box, word count, and send button.

Basic Usage

Attachment Display and Operations

Built-in attachment list layout (for display only, upload logic needs external control), supports preview and removal.

code-snippet.ts
ui-prototype.png
Attachment Display and Operations

Status and Toolbar Slots

Through toolbar and actions slots, you can freely extend the business logic at the bottom of the input box.

Status and Toolbar Slots

Use in Nuxt

This component fully supports Nuxt 3/4. In Nuxt projects, the component will be automatically imported.

For detailed configuration, please see Nuxt Integration.

Theme Variables

Variable NameDescriptionDefault Value
--yh-ai-editor-sender-bgPanel background colorvar(--yh-bg-color-overlay)
--yh-ai-editor-sender-radiusBorder radius12px
--yh-ai-editor-sender-borderBorder style1px solid var(--yh-border-color)
--yh-ai-editor-sender-shadowPanel shadow0 4px 16px rgba(0, 0, 0, 0.08)
--yh-ai-editor-sender-focus-borderFocus border style1px solid var(--yh-color-primary)

API

Props

NameDescriptionTypeDefault
modelValueV-model for input contentstring''
placeholderPlaceholder textstring''
disabledWhether to disablebooleanfalse
loadingWhether in loading/sending statebooleanfalse
attachmentsAttachment listAttachmentItem[][]
showWordLimitWhether to show word limitbooleantrue
maxLengthMaximum word limitnumberundefined
rowsDefault initial rowsnumber1

Events

NameDescriptionCallback Parameters
update:modelValueTriggered when content changes(value: string)
sendTriggered when clicking send or pressing Enter (without Shift)(value: string)
changeTriggered when content change is complete(value: string)
remove-attachmentTriggered when clicking attachment remove button(index: number, item: AttachmentItem)
clearTriggered when clearing content()

Slots

NameDescription
headerTop attachment display area slot
toolbarBottom left shortcut toolbar slot
actionsBottom right additional operation slot (after word count, before send button)
submitCustom send button

Released under the MIT License.