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

Command Panel

Trigger the command panel by typing /. Supports fuzzy search, icons, descriptions and cascade sub-commands.

Basic Command Panel

Basic Command Panel

Commands with Description

Commands with Description

Cascade Command Menu

Cascade Command Menu

Custom Trigger Character

Custom Trigger Character

API

Props

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

Command Panel Props

NameDescriptionTypeDefault
enable-commandsEnable command panelbooleantrue
command-triggerCommand trigger characterstring'/'
commandsCommand listAiCommandItem[][]
command-panel-positionPanel position'top' | 'bottom''bottom'
command-panel-alignPanel alignment'start' | 'center' | 'end''start'
command-panel-widthPanel widthstring | number320
command-panel-max-heightPanel max height (px)number400
show-command-descriptionShow command descriptionbooleantrue
show-command-iconShow command iconbooleantrue
command-search-delaySearch debounce delay (ms)number150
enable-command-cascadeEnable cascade sub-menubooleantrue
cascade-offsetCascade panel offset (px)number4

Events

NameDescriptionCallback Parameters
update:model-valueTriggered 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()

Command Panel Events

NameDescriptionCallback Parameters
command-selectTriggered when selecting a command(command: AiCommandItem, parentCommand?: AiCommandItem)
command-searchTriggered when searching commands(keyword: string)
command-panel-showTriggered when panel shows()
command-panel-hideTriggered when panel hides()
command-cascadeTriggered when cascade sub-menu opens(command: AiCommandItem, parentCommand: AiCommandItem)

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

AiCommandItem

PropertyDescriptionTypeRequired
idUnique identifierstring
labelDisplay textstring
keywordsFuzzy search keywordsstring[]
iconIcon namestring
descriptionCommand description textstring
disabledWhether this command is disabledboolean
childrenSub-command list (cascade menu)AiCommandItem[]
levelHierarchy depth levelnumber
dataCustom extension dataRecord<string, unknown>

AttachmentItem

PropertyDescriptionType
nameFile namestring
urlFile URLstring
statusUpload status'uploading' | 'success' | 'error'
percentageUpload progressnumber

Use in Nuxt

This component fully supports Nuxt 3/4. In Nuxt projects, the component and its types will be automatically imported on demand.

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)

Released under the MIT License.