Skip to content

Avatar ​

Display user profile images, initials, or icons with status indicators, badges, and grouping.

John DoeJSBO
vue
<script setup lang="ts">
import { VxAvatar } from 'veloxui'
</script>

<template>
  <VxAvatar src="https://example.com/photo.jpg" name="John Doe" />
  <VxAvatar name="Jane Smith" />
  <VxAvatar name="Bob" bg-color="#3b82f6" />
  <VxAvatar />
</template>

Sizes ​

Available in 5 preset sizes or any custom pixel value.

XSSMDFLGXL80
vue
<template>
  <VxAvatar name="Alice" size="xs" />   <!-- 24px -->
  <VxAvatar name="Alice" size="sm" />   <!-- 32px -->
  <VxAvatar name="Alice" />             <!-- 40px default -->
  <VxAvatar name="Alice" size="lg" />   <!-- 48px -->
  <VxAvatar name="Alice" size="xl" />   <!-- 64px -->
  <VxAvatar name="Alice" :size="80" />  <!-- 80px custom -->
</template>

Shapes ​

CircleSquare
vue
<template>
  <VxAvatar src="..." shape="circle" />
  <VxAvatar src="..." shape="square" />
</template>

Initials ​

Initials are auto-generated from name. Colors are deterministic per name.

AJBOCBDPEVFC
vue
<template>
  <VxAvatar name="Alice Johnson" />  <!-- AJ -->
  <VxAvatar name="Bob" />           <!-- BO -->
  <VxAvatar name="Charlie Brown" /> <!-- CB -->
</template>

Custom Colors ​

REGRBLPUDA
vue
<template>
  <VxAvatar name="Alice" bg-color="#ef4444" />
  <VxAvatar name="Alice" bg-color="#18181b" color="#fafafa" />
</template>

Status Indicator ​

OnlineOfflineBusyAway
vue
<template>
  <VxAvatar src="..." status="online" />
  <VxAvatar src="..." status="offline" />
  <VxAvatar src="..." status="busy" />
  <VxAvatar src="..." status="away" />
</template>

Status Ring ​

Use status-ring to show the status as a colored ring around the avatar instead of a dot.

AUOF
vue
<template>
  <VxAvatar src="..." status="online" status-ring />
  <VxAvatar src="..." status="busy" status-ring />
</template>

Notification Badge ​

Show a number badge or a simple dot indicator.

Alice3Bob99Charlie99+DIEV
vue
<script setup lang="ts">
import { VxAvatar } from 'veloxui'
</script>

<template>
  <!-- Number badge (caps at 99+) -->
  <VxAvatar src="..." :badge="3" />
  <VxAvatar src="..." :badge="150" />  <!-- shows "99+" -->

  <!-- Dot badge -->
  <VxAvatar name="Diana" dot />

  <!-- Custom badge color -->
  <VxAvatar name="Eve" dot badge-color="#3b82f6" />
</template>

Badge Position ​

TR1TL2BR3BL4
vue
<template>
  <VxAvatar :badge="1" badge-position="top-right" />
  <VxAvatar :badge="2" badge-position="top-left" />
  <VxAvatar :badge="3" badge-position="bottom-right" />
  <VxAvatar :badge="4" badge-position="bottom-left" />
</template>

Clickable ​

Make the avatar interactive with clickable. Renders as a <button> for accessibility with focus ring and press feedback.

vue
<script setup lang="ts">
import { VxAvatar } from 'veloxui'

function onAvatarClick() {
  alert('Avatar clicked!')
}
</script>

<template>
  <VxAvatar src="..." clickable @click="onAvatarClick" />
</template>

Tooltip ​

Hover to see the name as a native tooltip.

JS
vue
<template>
  <VxAvatar src="..." tooltip="John Doe - Admin" />
  <VxAvatar name="Jane" tooltip="Jane Smith - Editor" />
</template>

Lazy Loading ​

Add lazy to defer image loading until the avatar is near the viewport.

vue
<template>
  <VxAvatar src="..." lazy />
</template>

Srcset (Retina) ​

Provide srcset for responsive/retina images.

vue
<template>
  <VxAvatar
    src="photo-1x.jpg"
    srcset="photo-1x.jpg 1x, photo-2x.jpg 2x, photo-3x.jpg 3x"
  />
</template>

Bordered ​

AL
vue
<template>
  <VxAvatar src="..." bordered />
  <VxAvatar src="..." bordered border-color="#3b82f6" />
</template>

Fallback Slot ​

Use the fallback slot for completely custom fallback content when no image or name is provided.

🤖AI
vue
<template>
  <VxAvatar size="lg" bg-color="#18181b">
    <template #fallback>
      <span style="font-size: 20px;">🤖</span>
    </template>
  </VxAvatar>
</template>

Image Fallback ​

When the image fails to load, falls back to initials, then fallback slot, then default user icon.

Fallback User
vue
<template>
  <VxAvatar src="https://broken.url" name="Fallback User" />
  <VxAvatar src="https://broken.url" />
</template>

Avatar Group ​

Stack avatars with overlap. Hover to pop out individual avatars.

AliceBobCharlieDianaEV
vue
<script setup lang="ts">
import { VxAvatar, VxAvatarGroup } from 'veloxui'
</script>

<template>
  <VxAvatarGroup size="lg">
    <VxAvatar src="..." name="Alice" />
    <VxAvatar src="..." name="Bob" />
    <VxAvatar src="..." name="Charlie" />
    <VxAvatar name="Eve" />
  </VxAvatarGroup>
</template>

Group with +N Overflow ​

Set max to limit visible avatars. Remaining count shows as a "+N" badge.

AliceBobCharlie +4
vue
<template>
  <VxAvatarGroup size="lg" :max="3">
    <VxAvatar src="..." name="Alice" />
    <VxAvatar src="..." name="Bob" />
    <VxAvatar src="..." name="Charlie" />
    <VxAvatar src="..." name="Diana" />
    <VxAvatar src="..." name="Eve" />
    <!-- Shows "+2" overflow badge -->
  </VxAvatarGroup>
</template>

Group Overlap Control ​

Adjust how much avatars overlap with the overlap prop (percentage of avatar size).

overlap=15
overlap=25
overlap=40
vue
<template>
  <VxAvatarGroup :overlap="15">...</VxAvatarGroup>  <!-- less overlap -->
  <VxAvatarGroup :overlap="25">...</VxAvatarGroup>  <!-- default -->
  <VxAvatarGroup :overlap="40">...</VxAvatarGroup>  <!-- more overlap -->
</template>

Square Group ​

ABCDI
vue
<template>
  <VxAvatarGroup shape="square" size="lg">
    <VxAvatar src="..." />
    <VxAvatar name="Diana" />
  </VxAvatarGroup>
</template>

Avatar Props ​

PropTypeDefaultDescription
srcstring''Image URL
srcsetstring''Responsive image srcset
altstring''Image alt text
namestring''Name for initials and auto-color
size'xs' | 'sm' | 'default' | 'lg' | 'xl' | number'default'Avatar size
shape'circle' | 'square''circle'Avatar shape
colorstring''Text/icon color
bgColorstring''Background color (overrides auto-color)
iconComponent—Custom icon component
borderedbooleanfalseShow border
borderColorstring''Custom border color
status'online' | 'offline' | 'busy' | 'away'''Status indicator
statusPosition'top-right' | 'bottom-right' | 'top-left' | 'bottom-left''bottom-right'Status dot position
statusRingbooleanfalseShow status as ring instead of dot
badgestring | number—Badge number (caps at 99+)
dotbooleanfalseShow dot badge
badgePosition'top-right' | 'bottom-right' | 'top-left' | 'bottom-left''top-right'Badge/dot position
badgeColorstring'#ef4444'Badge/dot color
clickablebooleanfalseMake interactive (renders as button)
tooltipstring''Native tooltip on hover
lazybooleanfalseLazy load image

AvatarGroup Props ​

PropTypeDefaultDescription
maxnumber0Max visible avatars (0 = all)
sizeAvatarSize'default'Size for all children
shape'circle' | 'square''circle'Shape for all children
borderedbooleantrueBorder all children
overlapnumber25Overlap percentage (0-100)

Events ​

EventTypeDescription
error(event)Image failed to load
click(event)Avatar clicked (only when clickable)

Slots ​

SlotDescription
defaultCustom overlay content
fallbackCustom fallback when no image/name/icon