Skip to content

AiConversations

AiConversations is a sidebar component tailored for AI chat sessions, offering full interactive capabilities for creating, switching, renaming, and deleting conversations.

Basic Usage

Demonstrates basic list rendering and interactions.

Today
Vue 3 Component Guide15:36
Last 7 Days
Performance Optimization4/20Crucial for modern web development...
Basic Usage

Custom Theme

Use theme-overrides to customize component styles.

Today
Dark Theme Chat16:36
Custom Theme

Pinning & Grouping

Supported grouping by time by default, and pinning conversations.

Pinned
Pinned Conversation16:36
Today
Regular Conversation16:35
Pinning & Grouping

Virtual Scroll

Use virtual-scroll to improve performance for massive history items.

History Record #016:36
History Record #115:36
History Record #214:36
History Record #313:36
History Record #412:36
History Record #511:36
History Record #610:36
History Record #709:36
History Record #808:36
Virtual Scroll

API

Props

NameDescriptionTypeDefault
dataList dataAiConversation[][]
activeIdCurrently active IDstring''
loadingShows loading statebooleanfalse
theme-overridesTheme variables overrideAiConversationsThemeVars
groupedWhether to group conversations by timebooleantrue
virtual-scrollEnable virtual scrollbooleanfalse
virtual-scroll-heightContainer height for virtual scrollnumber400
virtual-scroll-item-heightItem height for virtual scrollnumber50
virtual-scroll-overscanNumber of items to render outside viewportnumber3

Events

NameDescriptionCallback Parameters
update:activeIdEmitted when selection changes(id: string) => void
createEmitted when clicking Add button() => void
deleteEmitted when clicking Delete button(item: AiConversation) => void
editEmitted when finishing title edit(item: AiConversation, newTitle: string) => void
clickEmitted when clicking list item(item: AiConversation) => void
pinEmitted when clicking Pin button(item: AiConversation, pinned: boolean) => void

Slots

NameDescriptionSlot Scope
add-iconCustom icon for Add button
add-textCustom text for Add button
group-labelCustom text for group labels{ label: string }
edit-iconCustom icon for Edit button
delete-iconCustom icon for Delete button
emptyLayout when list is empty

Methods

NameDescriptionParameters
scrollToItemScroll to item by ID(id: string)
scrollToIndexScroll to item by index(index: number)

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-conversations-bg-colorContainer background colorvar(--yh-bg-color)
--yh-ai-conversations-border-colorBorder colorvar(--yh-border-color)
--yh-ai-conversations-header-paddingHeader padding16px
--yh-ai-conversations-item-paddingItem padding12px 16px
--yh-ai-conversations-hover-bg-colorItem hover background colorvar(--yh-bg-color-page)
--yh-ai-conversations-active-bg-colorActive item background colorvar(--yh-color-primary-light-9)
--yh-ai-conversations-active-text-colorActive item text colorvar(--yh-color-primary)
--yh-ai-conversations-title-font-sizeTitle font size14px
--yh-ai-conversations-time-font-sizeTime font size12px

Released under the MIT License.