Custom HTML content
Custom HTML content
` and `` blocks with proper syntax highlighting styles
- Right-aligned messages (`.Message.right .Bubble`) use brand color gradient
- Automatically adapts to dark mode with CSS variables
```
--------------------------------
### Avatar Component
Source: https://github.com/kevinjiang2022/chatui_vue3/blob/main/_autodocs/api-reference/components.md
The Avatar component displays user images or fallback content, supporting various sizes and shapes.
```APIDOC
## Avatar Component
### Description
User avatar component supporting images, shapes, and sizes.
### Import
```typescript
import { Avatar } from 'chatui-vue3'
```
### Component Props
| Prop | Type | Default | Description |
|------|------|---------|-------------|
| `src` | `string` | `''` | Image URL |
| `alt` | `string` | `''` | Image alt text |
| `url` | `string` | `''` | Link URL (renders as `` if provided) |
| `size` | `'sm' | 'md' | 'lg'` | `'md'` | Avatar size |
| `shape` | `'circle' | 'square'` | `'circle'` | Avatar shape |
| `className` | `string` | `''` | Additional CSS class |
### Size Dimensions
- `'sm'`: 24x24px
- `'md'`: 32x32px
- `'lg'`: 40x40px
### Slots
| Slot | Scope | Description |
|------|-------|-------------|
| `default` | — | Fallback content if no image |
### Usage Example
```vue
```
```
--------------------------------
### Button Types - ButtonVariant
Source: https://github.com/kevinjiang2022/chatui_vue3/blob/main/_autodocs/types.md
Defines the visual style of buttons, such as text-only, outlined, or solid filled.
```APIDOC
## Button Types - ButtonVariant
### Description
Implicit union type from Button props.
### Values
- **'text'**: Text-only button (no background)
- **'outline'**: Outlined button (border only)
- **''**: Solid filled button (default)
### Used by
`Button` component `variant` prop
```
--------------------------------
### reflow
Source: https://github.com/kevinjiang2022/chatui_vue3/blob/main/_autodocs/MODULES.md
Forces a reflow of the DOM for a given element.
```APIDOC
## reflow
### Description
Forces a reflow of the DOM for a given element.
### Function Signature
`reflow(el: HTMLElement): number`
### Return Value
- Returns a number representing the forced reflow value.
```
--------------------------------
### Add ARIA Labels for Accessibility
Source: https://github.com/kevinjiang2022/chatui_vue3/blob/main/_autodocs/ADVANCED.md
Enhance accessibility by adding ARIA labels to chat components for semantic meaning. This helps screen readers and assistive technologies.
```vue
```
--------------------------------
### Debounce Input Changes
Source: https://github.com/kevinjiang2022/chatui_vue3/blob/main/_autodocs/ADVANCED.md
Utilize `@vueuse/core`'s `useDebounceFn` to limit the rate at which input change events are emitted, preventing excessive updates during typing.
```typescript
import { useDebounceFn } from '@vueuse/core'
const handleInputChange = useDebounceFn((value: string) => {
emit('inputChange', value)
}, 300)
```
--------------------------------
### Detect Safari with isSafari
Source: https://github.com/kevinjiang2022/chatui_vue3/blob/main/_autodocs/utilities.md
Detects if the current browser is Safari, excluding Chrome on Android. Use for applying Safari-specific workarounds.
```typescript
import { isSafari } from 'chatui-vue3'
if (isSafari) {
// Apply Safari-specific workarounds
rootElement.dataset.safari = ''
}
```
--------------------------------
### Composer Input Type
Source: https://github.com/kevinjiang2022/chatui_vue3/blob/main/_autodocs/types.md
Defines the type of input accepted by the composer component, either text or voice.
```typescript
type InputType = 'voice' | 'text'
```
--------------------------------
### reflow
Source: https://github.com/kevinjiang2022/chatui_vue3/blob/main/_autodocs/utilities.md
Forces DOM reflow by reading element's offsetHeight. This is useful for ensuring styles are applied before animations or transitions.
```APIDOC
## reflow
### Description
Forces DOM reflow by reading element's offsetHeight.
### Method
`reflow(el: HTMLElement): number`
### Parameters
#### Path Parameters
- **el** (`HTMLElement`) - Required - DOM element to reflow
### Return Type
`number` - The element's offsetHeight (in pixels)
### Description
Reads the `offsetHeight` property of an HTML element, which forces the browser to synchronously calculate and update layout. Useful for ensuring styles are applied before animations or transitions.
### Usage Example
```typescript
import { reflow } from 'chatui-vue3'
// Force reflow before applying animation
const element = document.querySelector('.message')
reflow(element)
element.classList.add('animate-in')
```
```
--------------------------------
### Message Structure Definition
Source: https://github.com/kevinjiang2022/chatui_vue3/blob/main/_autodocs/QUICK_START.md
Defines the structure of a message object, including type, content, position, user information, and creation timestamp.
```typescript
interface Message {
type: string // 'text', 'system', custom types
content: any // Type-specific content
position?: 'left' | 'right' | 'center'
user?: {
avatar?: string
name?: string
url?: string
}
createdAt?: number // Unix timestamp (auto-set if omitted)
}
```
--------------------------------
### Button Color Type
Source: https://github.com/kevinjiang2022/chatui_vue3/blob/main/_autodocs/types.md
Defines the possible color variants for buttons, including primary and default.
```typescript
type ButtonColor = 'primary' | ''
```