Skip to main content

Avatar

An image element with a fallback for representing the user.

Avatar

STU
STU
STU
STU

Stacked Avatars

STSTST
STSTST
STSTST
STSTST
import {
Avatar,
AvatarImage,
AvatarFallback,
AvatarGroup,
} from "@/components/ui/avatar"

{/* Single avatar */}
<Avatar size="md">
<AvatarImage src="/img/stx-logo.png" alt="STX" />
<AvatarFallback>ST</AvatarFallback>
</Avatar>

{/* Stacked avatars */}
<AvatarGroup size="md">
<Avatar>
<AvatarImage src="/img/stx-logo.png" alt="STX" />
<AvatarFallback>ST</AvatarFallback>
</Avatar>
<Avatar>
<AvatarImage src="/img/stx-logo.png" alt="STX" />
<AvatarFallback>ST</AvatarFallback>
</Avatar>
<Avatar>
<AvatarImage src="/img/stx-logo.png" alt="STX" />
<AvatarFallback>ST</AvatarFallback>
</Avatar>
</AvatarGroup>

Sizes

SizeClassDimensions
xssize-624×24px
smsize-832×32px
mdsize-1248×48px
lgsize-2080×80px

API Reference

Avatar

PropTypeDefaultDescription
size"xs" | "sm" | "md" | "lg""md"Controls the avatar dimensions

AvatarGroup

PropTypeDefaultDescription
size"xs" | "sm" | "md" | "lg""md"Controls the size of all child avatars and their overlap spacing

Accessibility

  • Uses Radix UI's Avatar primitive with proper image loading states
  • AvatarFallback renders when the image fails to load or while loading
  • Always provide an alt attribute on AvatarImage for screen readers
  • Fallback text should be initials or a meaningful abbreviation