Skip to content
Latestv1.0.60

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.

Basic Usage

Custom Theme

Use theme-overrides to customize component styles.

Custom Theme

Pinning & Grouping

Supported grouping by time by default, and pinning conversations.

Pinning & Grouping

Virtual Scroll

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

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.