Skip to content

AiSender

AiSender is a smart input component with multi-line auto-resize, integrated icons, slash commands, and file attachment previews.

Basic Usage

Supports automatic submission when pressing Enter.

Basic Usage

Loading State

Use :loading to indicate that AI is processing and input is disabled.

Loading State

Advanced Features & Multi-modal

Provides high-level capabilities such as max-length, show-word-limit, and clearable. Easily implement complex input containers by utilizing prefix and actions slots.

40 / 200
Advanced Modal

Preset Interactions (AiInputAction Pattern)

Via the #actions slot, you can easily integrate common preset instructions such as summarization, polishing, etc.

Preset Actions Panel

Fully Custom Submit Slot

You can completely take over the submit area view logic via the #submit slot.

Slash Commands

Type / to trigger the command panel. Quickly select preset Prompt templates.

Slash Commands

Attachments Preview

Supports previewing images and files before sending, with built-in upload progress and removal capability.

Loading...
image.png
report.pdf
Attachments

API

Props

PropertyDescriptionTypeDefault
modelValue / v-modelInput content bindingstring''
placeholderPlaceholder textstring'Send a message...'
loadingWhether AI is respondingbooleanfalse
disabledWhether disabledbooleanfalse
maxLengthNative maxlength limitnumber
clearableWhether to show clear buttonbooleanfalse
showWordLimitWhether to show character countbooleanfalse
commandsSlash command listAiCommand[][]
attachmentsSelected attachment listAiAttachment[][]
themeOverridesTheme variable overridesComponentThemeVars

AiCommand

PropertyDescriptionType
keyCommand keyword (e.g. summary)string
labelDisplay namestring
iconIcon namestring
descriptionShort descriptionstring
promptPrompt prefix to fill instring

AiAttachment

PropertyDescriptionType
idUnique identifierstring
nameFilenamestring
typeFile typestring
urlPreview image or URLstring
statusStatus'uploading' | 'success' | 'error'
progressUpload progress (0-100)number

Events

NameDescriptionParameters
sendFired on send button or Enter(value: string) => void
clearFired when clear button is clicked
commandFired when command is selected(command: AiCommand) => void
remove-attachmentFired when attachment is removed(file: AiAttachment) => void

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-sender-bgInput background colorvar(--yh-bg-color)
--yh-ai-sender-border-colorBorder colorvar(--yh-border-color)
--yh-ai-sender-border-radiusBorder radiusvar(--yh-border-radius-base)
--yh-ai-sender-focus-border-colorFocus border colorvar(--yh-color-primary)
--yh-ai-sender-text-colorInput text colorvar(--yh-text-color-primary)
--yh-ai-sender-placeholder-colorPlaceholder text colorvar(--yh-text-color-placeholder)

Slots

NameDescription
prefixPrefix content at top-left
actionsWrapper around send button
submitCustom submit button, exposes disabled, loading, submit

Released under the MIT License.