Avatar
Avatar is a component that visually represents a user or entity. Supports image, initials, and icon fallbacks, with status indicators and group display.
Playground
<Avatar>
<AvatarImage src="/avatar.jpg" alt="User" />
<AvatarFallback>JD</AvatarFallback>
</Avatar>Sizes
xssmdefaultlgxl2xl| Size | Size | Font | Status Dot | Preview |
|---|---|---|---|---|
xs | 24px | 10px | 6px | JD |
sm | 32px | 12px | 8px | JD |
default | 40px | 14px | 10px | JD |
lg | 48px | 16px | 12px | JD |
xl | 64px | 20px | 14px | JD |
2xl | 80px | 24px | 16px | JD |
Features
Shapes
<Avatar shape="circle">
<AvatarImage src="/avatar.jpg" alt="User" />
<AvatarFallback>JD</AvatarFallback>
</Avatar>
<Avatar shape="square">
<AvatarImage src="/avatar.jpg" alt="User" />
<AvatarFallback>JD</AvatarFallback>
</Avatar>Status
<Avatar status="online">
<AvatarImage src="/avatar.jpg" alt="User" />
<AvatarFallback>JD</AvatarFallback>
</Avatar>
<Avatar status="offline">...</Avatar>
<Avatar status="busy">...</Avatar>
<Avatar status="away">...</Avatar>Fallback
When an image fails to load, initials or an icon are shown as a fallback.
{/* Image with fallback */}
<Avatar>
<AvatarImage src="/avatar.jpg" alt="User" />
<AvatarFallback>JD</AvatarFallback>
</Avatar>
{/* Initials only */}
<Avatar>
<AvatarFallback>JD</AvatarFallback>
</Avatar>
{/* Icon fallback */}
<Avatar>
<AvatarFallback>
<User className="w-1/2 h-1/2" />
</AvatarFallback>
</Avatar>Avatar Group
Displays multiple avatars stacked together. Use max to limit the number shown.
<AvatarGroup>
<Avatar>
<AvatarImage src="/avatar-1.jpg" alt="User 1" />
<AvatarFallback>JD</AvatarFallback>
</Avatar>
<Avatar>
<AvatarImage src="/avatar-2.jpg" alt="User 2" />
<AvatarFallback>EB</AvatarFallback>
</Avatar>
...
</AvatarGroup><AvatarGroup max={3}>
<Avatar>
<AvatarImage src="/avatar-1.jpg" alt="User 1" />
<AvatarFallback>JD</AvatarFallback>
</Avatar>
...{/* 5 avatars total */}
</AvatarGroup>API
Component Structure
Avatar— Radix Avatar.ImagePropsImage.FallbackPropsFallback (supports name and colorized).GroupPropsGroup display (supports max)Props
Avatar
size"default""xs" | "sm" | "default" | "lg" | "xl" | "2xl"Avatar size (24/32/40/48/64/80px)
shape"circle""circle" | "square"Shape (circle / rounded square)
statusundefined"online" | "offline" | "busy" | "away"Status dot indicator
| Name | Type | Default | Description |
|---|---|---|---|
size | "xs" | "sm" | "default" | "lg" | "xl" | "2xl" | "default" | Avatar size (24/32/40/48/64/80px) |
shape | "circle" | "square" | "circle" | Shape (circle / rounded square) |
status | "online" | "offline" | "busy" | "away" | undefined | Status dot indicator |
AvatarImage
srcundefinedstringImage URL
altundefinedstringAlternative text for the image
onLoadingStatusChangeundefined(status: "idle" | "loading" | "loaded" | "error") => voidCallback for loading status changes
| Name | Type | Default | Description |
|---|---|---|---|
src | string | undefined | Image URL |
alt | string | undefined | Alternative text for the image |
onLoadingStatusChange | (status: "idle" | "loading" | "loaded" | "error") => void | undefined | Callback for loading status changes |
AvatarFallback
size"default""xs" | "sm" | "default" | "lg" | "xl" | "2xl"For font size scaling
nameundefinedstringAuto-generates initials and color from name. Overrides initials if children are provided
colorizedundefinedstringAuto-applies color only (initials manual). name takes precedence if provided
colorVariant"vivid""vivid" | "soft"Color style: vivid (dark background + white text) / soft (light background + dark text)
delayMsundefinednumberDelay before showing fallback (ms)
| Name | Type | Default | Description |
|---|---|---|---|
size | "xs" | "sm" | "default" | "lg" | "xl" | "2xl" | "default" | For font size scaling |
name | string | undefined | Auto-generates initials and color from name. Overrides initials if children are provided |
colorized | string | undefined | Auto-applies color only (initials manual). name takes precedence if provided |
colorVariant | "vivid" | "soft" | "vivid" | Color style: vivid (dark background + white text) / soft (light background + dark text) |
delayMs | number | undefined | Delay before showing fallback (ms) |
AvatarGroup
maxundefinednumberMaximum number shown. Excess displayed as "+N"
size"default""xs" | "sm" | "default" | "lg" | "xl" | "2xl"Child avatar size (applied to "+N" badge)
shape"circle""circle" | "square"Child avatar shape (applied to "+N" badge)
| Name | Type | Default | Description |
|---|---|---|---|
max | number | undefined | Maximum number shown. Excess displayed as "+N" |
size | "xs" | "sm" | "default" | "lg" | "xl" | "2xl" | "default" | Child avatar size (applied to "+N" badge) |
shape | "circle" | "square" | "circle" | Child avatar shape (applied to "+N" badge) |
Customization
Pass the name prop to auto-generate initials and a color.
name prop — Auto initials + color
<AvatarFallback name="John Doe" /> {/* → "JD" + color */}
<AvatarFallback name="Emma Brown" /> {/* → "EB" + color */}Vivid vs Soft
Google / Slack / Teams
<AvatarFallback name={name} />Notion / Linear
<AvatarFallback name={name} colorVariant="soft" />CJK Support
<AvatarFallback name="김민수" />
<AvatarFallback name="田中太郎" />
<AvatarFallback name="李明" />Image + Fallback
<Avatar>
<AvatarImage src={url} alt={name} />
<AvatarFallback name={name} />
</Avatar>Tip:The same name always produces the same color (deterministic hash). Pass children to override auto-generated initials.
Anatomy
Best Practices
Do
- ✓Always provide alt text
- ✓Always pair AvatarImage with a fallback
- ✓Use consistent sizes within a group
- ✓Use status only where it carries meaning
Don't
- ✗Don't use image avatars without alt text
- ✗Don't use AvatarImage without a fallback
- ✗Don't mix sizes within a group
- ✗Don't use avatars for purely decorative purposes
Accessibility
Keyboard
ARIA / WCAG
role="img"Auto-applied by RadixaltDescribes image via alt text- Fallback provides text alternative
- Status dot is decorative (supplement with text)