Skip to content

AiMention

Based on the Mention component, specifically designed for AI assistants. Supports common interactions in AI scenarios such as calling Agents (intelligence), referencing Context (documents, tables, knowledge bases) through @ and other triggers.

Basic Usage

Displays the standard style of the AiMention component, including icon differentiation for different types, description info, and type tags.

Basic Usage

Type Filtering

Through the types attribute, you can implement type filtering under different trigger prefixes, such as @ for waking up agents and # for referencing knowledge base files.

Only Agent (@ Call...)

Only Context (# Ref...)

Type Filtering & Custom Prefix

Use in Nuxt

This component perfectly supports Nuxt 3/4 SSR. In Nuxt projects, the component is automatically registered and does not need to be imported manually.

For detailed configuration, please refer to the Nuxt Integration Document.

SSR Friendly

AiMention has passed full SSR testing and supports server-side rendering to ensure first-screen loading performance.

API

Props

PropertyDescriptionTypeDefault
v-modelBinding valuestring
optionsMention options listAiMentionOption[][]
typesAllowed types list('agent'|'document'|'table'|'knowledge')[]['agent', 'document', 'table']
prefixTrigger prefixstring | string[]@
show-iconWhether to show iconbooleantrue
show-descriptionWhether to show descriptionbooleantrue
theme-overridesComponent theme overridesComponentThemeVars

AiMentionOption

PropertyDescriptionTypeDefault
labelDisplay textstring
valueSelected valuestring
typeAI Type'agent' | 'document' | 'table' | 'knowledge'
iconCustom iconstring
descriptionDescription textstring

Slots

Slot NameDescriptionParameters
labelCustom option content{ option: AiMentionOption }
emptyContent when no matches
loadingLoading content

Theme Variables

VariableDescriptionDefault
--yh-ai-mention-option-heightOption height56px
--yh-ai-mention-agent-colorAgent type theme colorvar(--yh-color-primary)
--yh-ai-mention-doc-colorDocument type theme color#47c2ff
--yh-ai-mention-table-colorTable type theme color#10b981
--yh-ai-mention-knowledge-colorKnowledge base type theme color#f59e0b

Released under the MIT License.