Skip to main content

Message Components

Message display related components: ConversationList, Conversation, Subtitle.

ConversationList

Conversation history list component, automatically subscribes to conversation changes.

Basic Usage

<script setup lang="ts">
import {PilotKit, ConversationList} from '@bdky/aaas-pilot-kit-vue3-widget';
import '@bdky/aaas-pilot-kit-vue3-widget/styles.css';
</script>

<template>
<PilotKit v-bind="props">
<ConversationList />
</PilotKit>
</template>

Responsive Adaptation

📱 See Responsive Adaptation Guide

FeaturePCMobile
Conversation DisplayShow all historyShow only latest one
Close ButtonVisibleHidden
Scroll Follow ButtonVisibleHidden
PositionAbsolute positioning on leftRelative positioning

Props

PropertyTypeDefaultDescription
variant'auto' | 'mobile' | 'desktop''auto'Display mode
classstring-Custom class name
styleCSSProperties-Custom style
autoScrollbooleantrueWhether to auto-scroll to bottom
closablebooleantrueWhether to show close button

Events

EventTypeDescription
@close() => voidClose callback

Slots

SlotPropsDescription
default{conversations, latestConversation}Custom render
closeIcon-Custom close icon

Custom Rendering

<template>
<ConversationList v-slot="{conversations, latestConversation}">
<div class="my-conversation-list">
<div
v-for="conv in conversations"
:key="conv.id"
class="my-conversation-item"
>
{{ conv.type === 'client' ? 'User' : 'AI' }}
</div>
</div>
</ConversationList>
</template>

Style Customization

Class NameDescription
.apk-conversation-listRoot container
.apk-conversation-list--mobileMobile style
.apk-conversation-list--desktopDesktop style
.apk-conversation-list__innerInner scroll container
.apk-conversation-list__follow-buttonScroll follow button
.apk-conversation-list__icons-wrapperClose button container

Conversation

Single message component, displays message content.

Basic Usage

Usually used with ConversationList, but can also be used independently:

<script setup lang="ts">
import {Conversation} from '@bdky/aaas-pilot-kit-vue3-widget';

defineProps<{
conversations: any[];
}>();
</script>

<template>
<div>
<Conversation
v-for="(conv, index) in conversations"
:key="conv.id"
:conversation="conv"
:isLatest="index === conversations.length - 1"
/>
</div>
</template>

Responsive Adaptation

FeaturePCMobile
Border Radius20pxDifferent border radius for different directions
MarginLeft/right 30pxLeft/right 39px
BackgroundSemi-transparentDarker semi-transparent

Props

PropertyTypeDefaultDescription
conversationAnyConversationRequiredConversation object
isLatestbooleanfalseWhether it's the latest one
variant'auto' | 'mobile' | 'desktop''auto'Display mode
classstring-Custom class name
styleCSSProperties-Custom style

Events

EventTypeDescription
@complete(payload) => voidConversation completion callback

Slots

SlotPropsDescription
default{contents, fullText, type, isCompleted}Custom render

Custom Rendering

<template>
<Conversation
:conversation="conv"
v-slot="{contents, fullText, type, isCompleted}"
>
<div :class="['my-message', `my-message--${type}`]">
<p>{{ fullText }}</p>
<span v-if="!isCompleted" class="typing">...</span>
</div>
</Conversation>
</template>

Style Customization

Class NameDescription
.apk-conversationRoot container
.apk-conversation--clientUser message
.apk-conversation--aiAI message
.apk-conversation--mobileMobile style
.apk-conversation--desktopDesktop style
.apk-conversation__content-itemContent item
.apk-conversation__content-textText content
.apk-conversation__content-imageImage content
.apk-conversation__content-videoVideo content

Subtitle

Real-time subtitle component, displays content of the latest conversation.

Basic Usage

<script setup lang="ts">
import {PilotKit, Subtitle} from '@bdky/aaas-pilot-kit-vue3-widget';
import '@bdky/aaas-pilot-kit-vue3-widget/styles.css';
</script>

<template>
<PilotKit v-bind="props">
<Subtitle showSpeaker />
</PilotKit>
</template>

Expandable Subtitle

<script setup lang="ts">
import {ref} from 'vue';
import {Subtitle} from '@bdky/aaas-pilot-kit-vue3-widget';

const expanded = ref(false);
</script>

<template>
<Subtitle
expandable
:expanded="expanded"
@expand="expanded = true"
/>
</template>

Props

PropertyTypeDefaultDescription
classstring-Custom class name
styleCSSProperties-Custom style
showSpeakerbooleantrueWhether to show speaker
aiSpeakerNamestring'AI'AI speaker name
userSpeakerNamestring'Me'User speaker name
expandablebooleanfalseWhether expandable
expandedbooleanfalseWhether expanded

Events

EventTypeDescription
@expand() => voidExpand callback

Slots

SlotPropsDescription
default{speakerName, fullText, conversation, isExpanded, toggleExpand}Custom render

Custom Rendering

<template>
<Subtitle v-slot="{speakerName, fullText, isExpanded, toggleExpand}">
<div class="my-subtitle">
<span class="speaker">{{ speakerName }}</span>
<p class="text">{{ fullText }}</p>
<button @click="toggleExpand">
{{ isExpanded ? 'Collapse' : 'Expand' }}
</button>
</div>
</Subtitle>
</template>

Style Customization

Class NameDescription
.apk-subtitleRoot container
.apk-subtitle__wrapperContent wrapper
.apk-subtitle__expand-btnExpand button
.apk-subtitle__textText area
.apk-subtitle__scroll-viewScroll view