Avatar
The avatar shows a user's image in a circle, falling back to initials when the image is missing or fails to load. Avatars stack into groups with an optional overflow count, and a badge can mark status.
<span class="avatar">
<img
class="avatar-image"
src="https://images.unsplash.com/photo-1750390200282-bf7f669a9946?w=640&h=640&fit=facearea&facepad=3.2&auto=format&q=100&bg-remove=true&bg=e5e5e5"
alt="Leila Navarro"
/>
<span class="avatar-fallback">LN</span>
</span>
<span class="avatar">
<img
class="avatar-image"
src="https://images.unsplash.com/photo-1750390200293-92d5a788d3a2?w=640&h=640&fit=facearea&facepad=3&auto=format&q=100&bg-remove=true&bg=e5e5e5"
alt="Theo Marchetti"
/>
<span class="avatar-fallback">TM</span>
<span class="avatar-badge bg-green-600 dark:bg-green-800"></span>
</span>
<span class="avatar-group">
<span class="avatar">
<img
class="avatar-image"
src="https://images.unsplash.com/photo-1750390200282-bf7f669a9946?w=640&h=640&fit=facearea&facepad=3.2&auto=format&q=100&bg-remove=true&bg=e5e5e5"
alt="Leila Navarro"
/>
<span class="avatar-fallback">LN</span>
</span>
<span class="avatar">
<img
class="avatar-image"
src="https://images.unsplash.com/photo-1750390200293-92d5a788d3a2?w=640&h=640&fit=facearea&facepad=3&auto=format&q=100&bg-remove=true&bg=e5e5e5"
alt="Theo Marchetti"
/>
<span class="avatar-fallback">TM</span>
</span>
<span class="avatar">
<img
class="avatar-image"
src="https://images.unsplash.com/photo-1573497019236-17f8177b81e8?w=640&h=640&fit=facearea&facepad=3.2&auto=format&q=100&bg-remove=true&bg=e5e5e5"
alt="Camille Laurent"
/>
<span class="avatar-fallback">CL</span>
</span>
<span class="avatar-group-count">+3</span>
</span>Usage
Add the avatar class to a wrapper holding the image and the fallback initials. The image wins while it works; when it is missing or fails to load, the fallback shows instead. Give the <img> a meaningful alt, like the person's name.
<span class="avatar">
<img class="avatar-image" src="/portrait.webp" alt="Leila Navarro" />
<span class="avatar-fallback">LN</span>
</span>Examples
Basic
An image with fallback initials behind it.
Size
Add avatar-sm or avatar-lg to change the size.
<div class="flex flex-wrap items-center gap-2">
<span class="avatar avatar-sm">
<img
class="avatar-image"
src="https://images.unsplash.com/photo-1750390200282-bf7f669a9946?w=640&h=640&fit=facearea&facepad=3.2&auto=format&q=100&bg-remove=true&bg=e5e5e5"
alt="Leila Navarro"
/>
<span class="avatar-fallback">LN</span>
</span>
<span class="avatar">
<img
class="avatar-image"
src="https://images.unsplash.com/photo-1750390200282-bf7f669a9946?w=640&h=640&fit=facearea&facepad=3.2&auto=format&q=100&bg-remove=true&bg=e5e5e5"
alt="Leila Navarro"
/>
<span class="avatar-fallback">LN</span>
</span>
<span class="avatar avatar-lg">
<img
class="avatar-image"
src="https://images.unsplash.com/photo-1750390200282-bf7f669a9946?w=640&h=640&fit=facearea&facepad=3.2&auto=format&q=100&bg-remove=true&bg=e5e5e5"
alt="Leila Navarro"
/>
<span class="avatar-fallback">LN</span>
</span>
</div>Fallback
When the image is missing or fails to load, the initials take over.
Badge
Mark status with an avatar-badge; color it with utilities.
<span class="avatar">
<img
class="avatar-image"
src="https://images.unsplash.com/photo-1750390200282-bf7f669a9946?w=640&h=640&fit=facearea&facepad=3.2&auto=format&q=100&bg-remove=true&bg=e5e5e5"
alt="Leila Navarro"
/>
<span class="avatar-fallback">LN</span>
<span class="avatar-badge bg-green-600 dark:bg-green-800"></span>
</span>Badge with icon
The badge fits a small icon at the default and large sizes.
<span class="avatar">
<img
class="avatar-image"
src="https://images.unsplash.com/photo-1750390200293-92d5a788d3a2?w=640&h=640&fit=facearea&facepad=3&auto=format&q=100&bg-remove=true&bg=e5e5e5"
alt="Theo Marchetti"
/>
<span class="avatar-fallback">TM</span>
<span class="avatar-badge">
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><path d="M5 12h14"/><path d="M12 5v14"/></svg>
</span>
</span>Group
Avatars stack into a group with a ring separating them.
<span class="avatar-group">
<span class="avatar">
<img
class="avatar-image"
src="https://images.unsplash.com/photo-1750390200282-bf7f669a9946?w=640&h=640&fit=facearea&facepad=3.2&auto=format&q=100&bg-remove=true&bg=e5e5e5"
alt="Leila Navarro"
/>
<span class="avatar-fallback">LN</span>
</span>
<span class="avatar">
<img
class="avatar-image"
src="https://images.unsplash.com/photo-1750390200293-92d5a788d3a2?w=640&h=640&fit=facearea&facepad=3&auto=format&q=100&bg-remove=true&bg=e5e5e5"
alt="Theo Marchetti"
/>
<span class="avatar-fallback">TM</span>
</span>
<span class="avatar">
<img
class="avatar-image"
src="https://images.unsplash.com/photo-1573497019236-17f8177b81e8?w=640&h=640&fit=facearea&facepad=3.2&auto=format&q=100&bg-remove=true&bg=e5e5e5"
alt="Camille Laurent"
/>
<span class="avatar-fallback">CL</span>
</span>
</span>Group count
End the stack with an overflow count.
<span class="avatar-group">
<span class="avatar">
<img
class="avatar-image"
src="https://images.unsplash.com/photo-1750390200282-bf7f669a9946?w=640&h=640&fit=facearea&facepad=3.2&auto=format&q=100&bg-remove=true&bg=e5e5e5"
alt="Leila Navarro"
/>
<span class="avatar-fallback">LN</span>
</span>
<span class="avatar">
<img
class="avatar-image"
src="https://images.unsplash.com/photo-1750390200293-92d5a788d3a2?w=640&h=640&fit=facearea&facepad=3&auto=format&q=100&bg-remove=true&bg=e5e5e5"
alt="Theo Marchetti"
/>
<span class="avatar-fallback">TM</span>
</span>
<span class="avatar">
<img
class="avatar-image"
src="https://images.unsplash.com/photo-1573497019236-17f8177b81e8?w=640&h=640&fit=facearea&facepad=3.2&auto=format&q=100&bg-remove=true&bg=e5e5e5"
alt="Camille Laurent"
/>
<span class="avatar-fallback">CL</span>
</span>
<span class="avatar-group-count">+3</span>
</span>Group count with icon
The count slot fits an icon too.
<span class="avatar-group">
<span class="avatar">
<img
class="avatar-image"
src="https://images.unsplash.com/photo-1750390200282-bf7f669a9946?w=640&h=640&fit=facearea&facepad=3.2&auto=format&q=100&bg-remove=true&bg=e5e5e5"
alt="Leila Navarro"
/>
<span class="avatar-fallback">LN</span>
</span>
<span class="avatar">
<img
class="avatar-image"
src="https://images.unsplash.com/photo-1750390200293-92d5a788d3a2?w=640&h=640&fit=facearea&facepad=3&auto=format&q=100&bg-remove=true&bg=e5e5e5"
alt="Theo Marchetti"
/>
<span class="avatar-fallback">TM</span>
</span>
<span class="avatar">
<img
class="avatar-image"
src="https://images.unsplash.com/photo-1573497019236-17f8177b81e8?w=640&h=640&fit=facearea&facepad=3.2&auto=format&q=100&bg-remove=true&bg=e5e5e5"
alt="Camille Laurent"
/>
<span class="avatar-fallback">CL</span>
</span>
<span class="avatar-group-count">
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><path d="M5 12h14"/><path d="M12 5v14"/></svg>
</span>
</span>