Avatar
User avatars and identity marks
Avatar
The Avatar component displays user avatars, brand marks, or other circular content, supporting images, text (slot / name), and icons.
Basic Usage
Avatar
Image, name, icon, and fallback content.
Demo will load when visible.
Sizes
Preset sizes: small/medium/large/xlarge.
Demo will load when visible.
Text Avatars
Use text as avatar content.
Demo will load when visible.
Icon Avatars
Use icons as avatar content.
Demo will load when visible.
Avatar Group
Stacked avatars with a max limit.
Demo will load when visible.
Status
Status badge overlay.
Demo will load when visible.
Clickable Avatar
<template>
<TxAvatar
name="Click"
clickable
@click="handleAvatarClick"
/>
</template>
Contract
Avatar fallback priority is image, default slot, icon, name initials, then the default user icon. Image load errors fall back to the same non-image chain. size accepts presets, numbers, numeric strings, and px strings. TxAvatarGroup injects size only into child avatars that do not already set one, and renders +N when max hides extra avatars.
API Reference
Avatar Props
| Property | Type | Default | Description |
|---|---|---|---|
| src | - | Avatar image URL | |
| alt | - | Alt text | |
| name | - | Name (used for initials fallback) | |
| icon | - | Icon name (via TxIcon) | |
| size | smallmediumlargexlarge | Avatar size | |
| status | onlineofflinebusyaway | - | Status |
| clickable | Clickable state | ||
| backgroundColor | - | Custom background color | |
| textColor | - | Custom text color |
Avatar Events
| Property | Type | Default | Description |
|---|---|---|---|
| click | - | Triggered on click (clickable=true only) |
Avatar Slots
| Property | Type | Default | Description |
|---|---|---|---|
| default | - | - | Custom content (higher priority than icon/name) |