📌 Warning
Added in version 1.1.6 Added scroll to bottom button, similar to Doubao🔥. Added scrollbar on mouse hover to enhance interaction experience. Please update and try it out.
🐵 This warm tip was last updated: 2025-04-13
💡 Tip
Note: The new version's auto-scroll will automatically scroll when the list length changes. However, after scrolling up, you need to manually call the scrollToBottom method to re-enable auto-scroll. Or, when the scrollbar reaches the bottom, auto-scroll will be triggered again.
The logic is the same as before, so you can upgrade without any worries.
Introduction
BubbleList relies on the Bubble component and is used to display a list of chat bubbles. This component supports setting the maximum list height and has an auto-scroll feature. It also provides various scroll control methods that users can easily call. It is powerful and requires no mental burden for developers.
Code Examples
Basic Usage



Customized List



Auto Scroll & Scroll to Specific Position

Back to Top Button
Scroll Complete Event
📌 Warning
This is only needed in very special cases. It is not suitable for streaming output, as it will quickly trigger the typing end event.




Theme Overrides (themeOverrides)
Override BubbleList theme tokens via ConfigProvider.themeOverrides. See the full token list and template:
Using with x-markdown-vue
Starting from v2.0.0, the component library no longer bundles XMarkdown / XMarkdownAsync. For Markdown rendering, use x-markdown-vue or see the dedicated page: XMarkdown.
Installation
pnpm add x-markdown-vue
pnpm add katex
pnpm add shiki shiki-stream💡 Tip
If you need code block syntax highlighting, please install shiki and shiki-stream. Otherwise, you may see this error in the console: Streaming highlighter initialization failed: Error: Failed to load shiki-stream module
Basic Usage
Streaming Rendering
By setting the enable-animate property, you can achieve a typewriter effect:
<template>
<BubbleList :list="list">
<template #content="{ item }">
<MarkdownRenderer :markdown="item.content" :enable-animate="true" />
</template>
</BubbleList>
</template>
<script setup>
import { ref } from 'vue';
import { BubbleList } from 'vue-element-plus-x';
import { MarkdownRenderer } from 'x-markdown-vue';
import 'x-markdown-vue/style';
const list = ref([
{ content: '', placement: 'start' } // Streaming content will be updated dynamically
]);
</script>Props
| Name | Type | Required | Default | Description |
|---|---|---|---|---|
list | Array | Yes | None | Array containing bubble information. Each element is an object with content, placement, loading, shape, variant, and other Bubble properties to configure the display and style of each bubble. For Markdown, render via the #content slot. |
autoScroll | Boolean | No | true | Whether to enable automatic scrolling. |
maxHeight | String | No | '-' | Maximum height of the bubble list container.(By default, the height of the wrapper container is inherited) |
alwaysShowScrollbar | Boolean | No | false | Whether to always show the scrollbar. Default is false. |
backButtonThreshold | Number | No | 80 | Back to bottom button display threshold. When the scrollbar is more than this distance from the bottom, the button will be shown. |
showBackButton | Boolean | No | true | Whether to show the back to bottom button. Default is true. |
backButtonPosition | { bottom: '20px', left: 'calc(50% - 19px)' } | No | { bottom: '20px', left: 'calc(50% - 19px)' } | Position of the back to bottom button. Default is centered at the bottom. |
btnLoading | Boolean | No | true | Whether to enable loading state for the back to bottom button. Default is true. |
btnColor | String | No | '#409EFF' | Color of the back to bottom button. Default is '#409EFF'. |
btnIconSize | Number | No | 24 | Icon size of the back to bottom button. Default is 24px. |
triggerIndices | 'only-last' | 'all' | number[] | No | 'only-last' | Index array of bubbles that trigger the complete event. Default is 'only-last'. |
Events
| Event Name | Parameter | Type | Description |
|---|---|---|---|
@complete | (instance, index) | Function | Triggered when the typing effect of a bubble is completed. |
Ref Instance Methods
| Name | Type | Description |
|---|---|---|
scrollToTop | Function | Scroll to the top. |
scrollToBottom | Function | Scroll to the bottom. |
scrollToBubble | Function | Scroll to the specified bubble index. |
Slots
| Slot Name | Parameter | Type | Description |
|---|---|---|---|
#avatar | - | Slot | Custom avatar display content |
#header | - | Slot | Custom bubble header content |
#content | - | Slot | Custom bubble content |
#loading | - | Slot | Custom bubble loading state content |
#footer | - | Slot | Custom bubble footer content |
Features
- Smart Scrolling - Automatically tracks the latest message position
- Deep Customization - Full slot passthrough for bubble components
- Multiple Scrolling Methods - Scroll to top, bottom, or specific position
- Multiple Styles - Supports various styles such as round, square, etc.
