v1.2.1

Avatar

An image element with a fallback for representing the user.

Sizes

Four sizes: 24, 40, 56 and 80px.

html
S

sm

JD

md

JD

lg

JD

xl

<div class="vt-text-center">
  <div class="vt-avatar vt-avatar-sm">
    <span>S</span>
  </div>
  <p class="vt-text-xs vt-text-foreground-muted vt-mt-2">sm</p>
</div>

<div class="vt-text-center">
  <div class="vt-avatar vt-avatar-md">
    <span>JD</span>
  </div>
  <p class="vt-text-xs vt-text-foreground-muted vt-mt-2">md</p>
</div>

<div class="vt-text-center">
  <div class="vt-avatar vt-avatar-lg">
    <span>JD</span>
  </div>
  <p class="vt-text-xs vt-text-foreground-muted vt-mt-2">lg</p>
</div>

<div class="vt-text-center">
  <div class="vt-avatar vt-avatar-xl">
    <span>JD</span>
  </div>
  <p class="vt-text-xs vt-text-foreground-muted vt-mt-2">xl</p>
</div>

With Image

html
User
User
User
User
<div class="vt-avatar vt-avatar-md">
  <img src="https://i.pravatar.cc/80?img=1" alt="User">
</div>
<div class="vt-avatar vt-avatar-md">
  <img src="https://i.pravatar.cc/80?img=2" alt="User">
</div>
<div class="vt-avatar vt-avatar-md">
  <img src="https://i.pravatar.cc/80?img=3" alt="User">
</div>
<div class="vt-avatar vt-avatar-md">
  <img src="https://i.pravatar.cc/80?img=4" alt="User">
</div>

Fallback

Initials or icon when no image is available.

html
AB
CD
<div class="vt-avatar vt-avatar-md">
  <span>AB</span>
</div>
<div class="vt-avatar vt-avatar-md">
  <span>CD</span>
</div>

<div class="vt-avatar vt-avatar-md">
  <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" width="24" height="24" fill="none" class="vt-w-5 vt-h-5 vt-text-foreground-muted" aria-hidden="true">
    <path d="M20 21.0001C19.713 17.269 16.7289 14.3151 12.995 14.0662L12 13.9999C11.6446 14.0096 11.3134 14.0225 11.0008 14.0378C7.3 14.2192 4.28417 17.3057 4 21.0001" stroke="currentColor" stroke-linecap="round" stroke-linejoin="round" stroke-width="1.5"></path><circle cx="12" cy="6.99988" r="4" stroke="currentColor" stroke-linecap="round" stroke-linejoin="round" stroke-width="1.5"></circle>
  </svg>
</div>

Colors

Initials sit on a neutral surface; vt-avatar-brand marks your own product or the current user.

html
JD
AI
<div class="vt-avatar vt-avatar-md"><span>JD</span></div>
<div class="vt-avatar vt-avatar-md vt-avatar-brand"><span>AI</span></div>
<div class="vt-avatar vt-avatar-md vt-avatar-brand" role="img" aria-label="Assistant">
  <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" width="24" height="24" fill="none" class="vt-w-5 vt-h-5" aria-hidden="true">
    <path d="M15 2L15.5387 4.39157C15.9957 6.42015 17.5798 8.00431 19.6084 8.46127L22 9L19.6084 9.53873C17.5798 9.99569 15.9957 11.5798 15.5387 13.6084L15 16L14.4613 13.6084C14.0043 11.5798 12.4202 9.99569 10.3916 9.53873L8 9L10.3916 8.46127C12.4201 8.00431 14.0043 6.42015 14.4613 4.39158L15 2Z" stroke="currentColor" stroke-linejoin="round" stroke-width="1.5"></path><path d="M7 12L7.38481 13.7083C7.71121 15.1572 8.84275 16.2888 10.2917 16.6152L12 17L10.2917 17.3848C8.84275 17.7112 7.71121 18.8427 7.38481 20.2917L7 22L6.61519 20.2917C6.28879 18.8427 5.15725 17.7112 3.70827 17.3848L2 17L3.70827 16.6152C5.15725 16.2888 6.28879 15.1573 6.61519 13.7083L7 12Z" stroke="currentColor" stroke-linejoin="round" stroke-width="1.5"></path>
  </svg>
</div>

With Status

Online/offline indicator on the avatar.

html
User
User
EF
GH
<div class="vt-notification-badge vt-notification-badge-success">
  <div class="vt-avatar vt-avatar-md">
    <img src="https://i.pravatar.cc/80?img=5" alt="User">
  </div>
  <span class="vt-notification-dot"></span>
</div>

<div class="vt-notification-badge vt-notification-badge-warning">
  <div class="vt-avatar vt-avatar-md">
    <img src="https://i.pravatar.cc/80?img=6" alt="User">
  </div>
  <span class="vt-notification-dot"></span>
</div>

<div class="vt-notification-badge vt-notification-badge-neutral">
  <div class="vt-avatar vt-avatar-md">
    <span>EF</span>
  </div>
  <span class="vt-notification-dot"></span>
</div>

<div class="vt-notification-badge">
  <div class="vt-avatar vt-avatar-md">
    <span>GH</span>
  </div>
  <span class="vt-notification-dot"></span>
</div>

Avatar Group

Stack multiple avatars together.

html
User
User
User
User
+5
User
User
User
3 members online
<div class="vt-avatar-group">
  <div class="vt-avatar vt-avatar-md">
    <img src="https://i.pravatar.cc/80?img=10" alt="User">
  </div>
  <div class="vt-avatar vt-avatar-md">
    <img src="https://i.pravatar.cc/80?img=11" alt="User">
  </div>
  <div class="vt-avatar vt-avatar-md">
    <img src="https://i.pravatar.cc/80?img=12" alt="User">
  </div>
  <div class="vt-avatar vt-avatar-md">
    <img src="https://i.pravatar.cc/80?img=13" alt="User">
  </div>
  <div class="vt-avatar vt-avatar-md">
    <span>+5</span>
  </div>
</div>

<div class="vt-flex vt-items-center vt-gap-3">
  <div class="vt-avatar-group vt-avatar-group-sm">
    <div class="vt-avatar vt-avatar-sm">
      <img src="https://i.pravatar.cc/80?img=14" alt="User">
    </div>
    <div class="vt-avatar vt-avatar-sm">
      <img src="https://i.pravatar.cc/80?img=15" alt="User">
    </div>
    <div class="vt-avatar vt-avatar-sm">
      <img src="https://i.pravatar.cc/80?img=16" alt="User">
    </div>
  </div>
  <span class="vt-text-sm vt-text-foreground-muted">3 members online</span>
</div>

Guidelines

User
JD
Do
Provide an initials fallback for when the photo is unavailable.
S
JD
JD
Do
Use the size classes so text scales with the avatar.
JD
Don't
Don't override the built-in text sizing — it should scale with the avatar.

API Reference

Class Type Description
vt-avatar Base Base avatar — rounded, centered, overflow hidden, muted background
vt-avatar-sm Size Small avatar (24px)
vt-avatar-md Size Default avatar (40px)
vt-avatar-lg Size Large avatar (56px)
vt-avatar-xl Size Extra large avatar (80px)
vt-avatar-brand Color Initials or an icon on the brand fill (on-brand text) — the product, an assistant, the current user

Accessibility

Feature Details
Alt text Always provide meaningful alt text for user images
Fallback Initials or icon fallback when image is unavailable
Status Status indicators should have sr-only text describing the status
Decorative If avatar is next to username, use alt="" to avoid redundancy
Built with: