# Bubble Chat Bubble Component
# Features
Chat bubble component for displaying conversation content, supporting the following features:
- Custom bubble styles and colors
- Support for user and bot role layouts
- Adaptive content width
- Markdown content rendering support
- Typewriter effect integration
- Loading state display
- Custom avatar and layout
# Usage Examples
# Basic Usage
Basic bubble component usage, demonstrating bubble effects at different positions.
Copy
# Different Bubble Styles
Configure different styles and shapes of bubbles through variant and shape properties.
Copy
# Typewriter Effect
Enable typewriter effect through typing property to simulate real-time input.
Copy
# Loading State
Display loading state through loading property, supporting custom loading animations.
Copy
# Markdown Rendering
Enable Markdown content rendering through isMarkdown property.
Copy
# Custom Avatar and Content
Use slots to customize bubble avatar and content.
Copy
# Attributes
| Parameter | Description | Type | Default |
|---|---|---|---|
| content | Bubble content text | String | '' |
| avatar | Avatar image URL | String | '' |
| placement | Bubble position, options: 'start'(left)/'end'(right) | String | 'start' |
| variant | Bubble style, options: 'filled'/'borderless'/'outlined'/'shadow' | String | 'filled' |
| maxWidth | Maximum width of bubble | String | '500px' |
| avatarSize | Avatar size | Number | 0 |
| avatarGap | Gap between avatar and bubble | String | '12px' |
| avatarShape | Avatar shape, options: 'circle'/'square' | String | 'circle' |
| avatarSrcSet | Avatar image srcset attribute | String | '' |
| avatarAlt | Avatar image alt attribute | String | '' |
| avatarFit | Avatar image fit mode | String | 'cover' |
| noStyle | Whether to remove default styles | Boolean | false |
| typing | Typewriter effect configuration, set to true for default or pass object config: - interval: typing interval(ms) - step: characters per step - suffix: cursor char | Boolean/Object | undefined |
| loading | Whether to show loading state | Boolean | false |
| shape | Bubble shape, options: ''/'round'/'corner' | String | '' |
| isMarkdown | Whether to parse Markdown content | Boolean | false |
| isFog | Whether to enable fog effect | Boolean | false |
# Methods
| Method Name | Description | Parameters | Return Value |
|---|---|---|---|
| interrupt | Interrupt typing process | - | - |
| continueTyping | Continue interrupted typing | - | - |
| restart | Restart typing | - | - |
| destroy | Destroy component instance | - | - |
# Events
| Event Name | Description | Callback Parameters |
|---|---|---|
| start | Typing start event | Component instance |
| writing | Typing progress event | Component instance |
| finish | Typing complete event | Component instance |
| avatarError | Avatar loading error event | Error object |
# Slots
| Slot Name | Description |
|---|---|
| avatar | Custom avatar content |
| header | Custom bubble header content |
| content | Custom bubble main content |
| footer | Custom bubble footer content |
| loading | Custom loading state content |