Avatar Rails Components
Avatars represent people or accounts with profile images, presence indicators, and compact groups.
Examples
Basic Avatar
A simple circular avatar with a profile image.
<span class="relative inline-flex size-12 shrink-0 overflow-hidden rounded-full bg-neutral-100 after:pointer-events-none after:absolute after:inset-0 after:z-10 after:rounded-full after:content-[''] after:shadow-[inset_0_0_0_1px_rgb(0_0_0_/_10%)] dark:bg-neutral-800 dark:after:shadow-[inset_0_0_0_1px_rgb(255_255_255_/_10%)]">
<img
class="size-full object-cover"
src="https://images.unsplash.com/photo-1494790108377-be9c29b29330?w=160&h=160&fit=crop&crop=face&auto=format&q=80"
alt="Portrait of Olivia Martin">
</span>
Avatar with Status
An avatar with an online status indicator.
<span class="relative inline-flex size-12 shrink-0 rounded-full after:pointer-events-none after:absolute after:inset-0 after:z-10 after:rounded-full after:content-[''] after:shadow-[inset_0_0_0_1px_rgb(0_0_0_/_10%)] dark:after:shadow-[inset_0_0_0_1px_rgb(255_255_255_/_10%)]">
<img
class="size-full rounded-full object-cover"
src="https://images.unsplash.com/photo-1507003211169-0a1dd7228f2d?w=160&h=160&fit=crop&crop=face&auto=format&q=80"
alt="Portrait of Noah Williams">
<span class="absolute right-0 bottom-0 z-20 flex size-3">
<span class="absolute inline-flex size-full animate-ping rounded-full bg-green-400 opacity-75 dark:bg-green-300"></span>
<span class="relative inline-flex size-3 rounded-full bg-green-500 ring-2 ring-white dark:bg-green-400 dark:ring-neutral-950"></span>
<span class="sr-only">Online</span>
</span>
</span>
Avatar Group
A compact group of overlapping avatars with a count for the remaining people.
<!-- Recommended group overlap: xs -space-x-2, sm -space-x-3, md -space-x-4, lg -space-x-5, xl -space-x-6 -->
<div class="flex w-fit -space-x-4 [&>*]:isolate" role="group" aria-label="Project members">
<span class="relative inline-flex size-10 shrink-0 rounded-full after:pointer-events-none after:absolute after:inset-0 after:z-10 after:rounded-full after:content-[''] after:shadow-[inset_0_0_0_1px_rgb(0_0_0_/_10%)] dark:after:shadow-[inset_0_0_0_1px_rgb(255_255_255_/_10%)]">
<img
class="size-full rounded-full object-cover"
src="https://images.unsplash.com/photo-1494790108377-be9c29b29330?w=160&h=160&fit=crop&crop=face&auto=format&q=80"
alt="Olivia Martin">
</span>
<span class="relative inline-flex size-10 shrink-0 rounded-full after:pointer-events-none after:absolute after:inset-0 after:z-10 after:rounded-full after:content-[''] after:shadow-[inset_0_0_0_1px_rgb(0_0_0_/_10%)] dark:after:shadow-[inset_0_0_0_1px_rgb(255_255_255_/_10%)]">
<img
class="size-full rounded-full object-cover"
src="https://images.unsplash.com/photo-1507003211169-0a1dd7228f2d?w=160&h=160&fit=crop&crop=face&auto=format&q=80"
alt="Noah Williams">
</span>
<span class="relative inline-flex size-10 shrink-0 rounded-full after:pointer-events-none after:absolute after:inset-0 after:z-10 after:rounded-full after:content-[''] after:shadow-[inset_0_0_0_1px_rgb(0_0_0_/_10%)] dark:after:shadow-[inset_0_0_0_1px_rgb(255_255_255_/_10%)]">
<img
class="size-full rounded-full object-cover"
src="https://images.unsplash.com/photo-1438761681033-6461ffad8d80?w=160&h=160&fit=crop&crop=face&auto=format&q=80"
alt="Emma Davis">
</span>
<span class="relative inline-flex size-10 shrink-0 items-center justify-center rounded-full bg-neutral-100 text-xs font-medium text-neutral-600 after:pointer-events-none after:absolute after:inset-0 after:z-10 after:rounded-full after:content-[''] after:shadow-[inset_0_0_0_1px_rgb(0_0_0_/_10%)] dark:bg-neutral-800 dark:text-neutral-300 dark:after:shadow-[inset_0_0_0_1px_rgb(255_255_255_/_10%)]" aria-label="3 more project members">
+3
</span>
</div>
Avatar Sizes
Avatar sizes from extra small to extra large, with comments documenting dimensions and recommended group overlap: -space-x-2 for xs, -space-x-3 for sm, -space-x-4 for md, -space-x-5 for lg, and -space-x-6 for xl.
<div class="flex flex-wrap items-end justify-center gap-6">
<!-- Extra small (xs): 24px; recommended group overlap: -space-x-2 -->
<span class="relative inline-flex size-6 shrink-0 overflow-hidden rounded-full bg-neutral-100 after:pointer-events-none after:absolute after:inset-0 after:z-10 after:rounded-full after:content-[''] after:shadow-[inset_0_0_0_1px_rgb(0_0_0_/_10%)] dark:bg-neutral-800 dark:after:shadow-[inset_0_0_0_1px_rgb(255_255_255_/_10%)]">
<img
class="size-full object-cover"
src="https://images.unsplash.com/photo-1494790108377-be9c29b29330?w=160&h=160&fit=crop&crop=face&auto=format&q=80"
alt="Portrait of Olivia Martin at extra-small size">
</span>
<!-- Small (sm): 32px; recommended group overlap: -space-x-3 -->
<span class="relative inline-flex size-8 shrink-0 overflow-hidden rounded-full bg-neutral-100 after:pointer-events-none after:absolute after:inset-0 after:z-10 after:rounded-full after:content-[''] after:shadow-[inset_0_0_0_1px_rgb(0_0_0_/_10%)] dark:bg-neutral-800 dark:after:shadow-[inset_0_0_0_1px_rgb(255_255_255_/_10%)]">
<img
class="size-full object-cover"
src="https://images.unsplash.com/photo-1494790108377-be9c29b29330?w=160&h=160&fit=crop&crop=face&auto=format&q=80"
alt="Portrait of Olivia Martin at small size">
</span>
<!-- Medium (md): 40px; recommended group overlap: -space-x-4 -->
<span class="relative inline-flex size-10 shrink-0 overflow-hidden rounded-full bg-neutral-100 after:pointer-events-none after:absolute after:inset-0 after:z-10 after:rounded-full after:content-[''] after:shadow-[inset_0_0_0_1px_rgb(0_0_0_/_10%)] dark:bg-neutral-800 dark:after:shadow-[inset_0_0_0_1px_rgb(255_255_255_/_10%)]">
<img
class="size-full object-cover"
src="https://images.unsplash.com/photo-1494790108377-be9c29b29330?w=160&h=160&fit=crop&crop=face&auto=format&q=80"
alt="Portrait of Olivia Martin at medium size">
</span>
<!-- Large (lg): 48px; recommended group overlap: -space-x-5 -->
<span class="relative inline-flex size-12 shrink-0 overflow-hidden rounded-full bg-neutral-100 after:pointer-events-none after:absolute after:inset-0 after:z-10 after:rounded-full after:content-[''] after:shadow-[inset_0_0_0_1px_rgb(0_0_0_/_10%)] dark:bg-neutral-800 dark:after:shadow-[inset_0_0_0_1px_rgb(255_255_255_/_10%)]">
<img
class="size-full object-cover"
src="https://images.unsplash.com/photo-1494790108377-be9c29b29330?w=160&h=160&fit=crop&crop=face&auto=format&q=80"
alt="Portrait of Olivia Martin at large size">
</span>
<!-- Extra large (xl): 64px; recommended group overlap: -space-x-6 -->
<span class="relative inline-flex size-16 shrink-0 overflow-hidden rounded-full bg-neutral-100 after:pointer-events-none after:absolute after:inset-0 after:z-10 after:rounded-full after:content-[''] after:shadow-[inset_0_0_0_1px_rgb(0_0_0_/_10%)] dark:bg-neutral-800 dark:after:shadow-[inset_0_0_0_1px_rgb(255_255_255_/_10%)]">
<img
class="size-full object-cover"
src="https://images.unsplash.com/photo-1494790108377-be9c29b29330?w=160&h=160&fit=crop&crop=face&auto=format&q=80"
alt="Portrait of Olivia Martin at extra-large size">
</span>
</div>
Animated Avatar Group
A tightly stacked medium avatar group that smoothly expands to the recommended -space-x-4 overlap when hovering anywhere on the group.
<!-- Medium avatars normally use -space-x-4. This group rests at -space-x-6 and expands to the normal overlap on hover. -->
<div class="group flex w-fit -space-x-6 [&>*]:isolate" role="group" aria-label="Project members">
<span class="relative inline-flex size-10 shrink-0 rounded-full transition-transform duration-200 ease-in-out after:pointer-events-none after:absolute after:inset-0 after:z-10 after:rounded-full after:content-[''] after:shadow-[inset_0_0_0_1px_rgb(0_0_0_/_10%)] motion-reduce:transform-none motion-reduce:transition-none dark:after:shadow-[inset_0_0_0_1px_rgb(255_255_255_/_10%)]">
<img
class="size-full rounded-full object-cover"
src="https://images.unsplash.com/photo-1494790108377-be9c29b29330?w=160&h=160&fit=crop&crop=face&auto=format&q=80"
alt="Olivia Martin">
</span>
<span class="relative inline-flex size-10 shrink-0 rounded-full transition-transform duration-200 ease-in-out group-hover:translate-x-2 after:pointer-events-none after:absolute after:inset-0 after:z-10 after:rounded-full after:content-[''] after:shadow-[inset_0_0_0_1px_rgb(0_0_0_/_10%)] motion-reduce:transform-none motion-reduce:transition-none dark:after:shadow-[inset_0_0_0_1px_rgb(255_255_255_/_10%)]">
<img
class="size-full rounded-full object-cover"
src="https://images.unsplash.com/photo-1507003211169-0a1dd7228f2d?w=160&h=160&fit=crop&crop=face&auto=format&q=80"
alt="Noah Williams">
</span>
<span class="relative inline-flex size-10 shrink-0 rounded-full transition-transform duration-200 ease-in-out group-hover:translate-x-4 after:pointer-events-none after:absolute after:inset-0 after:z-10 after:rounded-full after:content-[''] after:shadow-[inset_0_0_0_1px_rgb(0_0_0_/_10%)] motion-reduce:transform-none motion-reduce:transition-none dark:after:shadow-[inset_0_0_0_1px_rgb(255_255_255_/_10%)]">
<img
class="size-full rounded-full object-cover"
src="https://images.unsplash.com/photo-1438761681033-6461ffad8d80?w=160&h=160&fit=crop&crop=face&auto=format&q=80"
alt="Emma Davis">
</span>
<span class="relative inline-flex size-10 shrink-0 items-center justify-center rounded-full bg-neutral-100 text-xs font-medium text-neutral-600 transition-transform duration-200 ease-in-out group-hover:translate-x-6 after:pointer-events-none after:absolute after:inset-0 after:z-10 after:rounded-full after:content-[''] after:shadow-[inset_0_0_0_1px_rgb(0_0_0_/_10%)] motion-reduce:transform-none motion-reduce:transition-none dark:bg-neutral-800 dark:text-neutral-300 dark:after:shadow-[inset_0_0_0_1px_rgb(255_255_255_/_10%)]" aria-label="3 more project members">
+3
</span>
</div>