Avatar
A person's photo, falling back to initials when none is on file. To show several people together use Avatar group.
Purpose
The fallback is the common case in this product: most members have no photo, so initials are what people actually see.
Example
When a photo is on file, compose AvatarImage with the fallback behind it — the initials render
while the image loads and whenever it fails. The alt names the person for screen readers:
<Avatar>
<AvatarImage src={member.photoUrl} alt="Josephine Tan" />
<AvatarFallback>JT</AvatarFallback>
</Avatar>For several people together — the overlapping cluster with an automatic overflow count — use Avatar group rather than composing it by hand.
Structure
The tokens behind the frame.
| Property | Value |
|---|---|
| Size | 40px (size-10) — resize with className |
| Shape | circle (rounded-full), content clipped (overflow-hidden) |
| Image | fills the frame (aspect-square size-full) |
| Fallback fill | --accent, with --accent-foreground initials |
| Fallback type | 14px / Inter 600 (text-sm font-semibold), centred |
Best practices
Do
- Always provide an
AvatarFallback— the photo is the exception, not the rule. - Keep initials to two characters, from the person's display name.
- Name the person in
altwhen the avatar is their only representation. - Use Avatar group for clusters — never overlap avatars by hand.
Don't
- Use an avatar for organisations or objects — it signals a person.
- Write
alt="avatar"oralt="photo"— thealtis the person's name or nothing. - Shrink below 24px; two initials stop being legible.
Accessibility & keyboard
altonAvatarImagenames the person — "Josephine Tan", not "avatar" or "profile photo".- The initials fallback is read as literal text ("JT"). When the person's name is already visible
next to the avatar — a table row, a comment header — that announcement is duplicate noise: put
aria-hidden="true"on theAvatarFallback, and an emptyalt=""on the image, so the visible name is the single source. - When the avatar stands alone (a topbar account button, a compact list), it must carry the name —
alton the image, or anaria-labelon the interactive element wrapping it. - Keyboard: none — an avatar is non-interactive. If it opens a menu, the wrapping button owns focus and the keyboard interaction.
Props
Avatar, AvatarImage and AvatarFallback are thin styled wrappers over the Radix Avatar
primitives and accept the corresponding Radix props unchanged — src, alt and
onLoadingStatusChange on the image, delayMs on the fallback — plus any HTML attribute.