Avatar
A person's picture, with initials while it loads or when it fails. Round, or square in Iwa; stacks into a group.
NUSASH
NUSHSAKK+3
Installation
Or with the shadcn CLI, from the registry:
Usage
Sizes and groups
size is sm, default, lg or xl; the initials follow it.
NUNUNUNU
AvatarGroup overlaps its avatars, and AvatarGroupCount ends the stack with the
number left out.
Villages
Round with the pill radius, so square in Iwa; the fallback sits on the muted surface, opaque so a stack never shows through in Kiri.
NUSASH
NUSHSAKK+3
NUSASH
NUSHSAKK+3
NUSASH
NUSHSAKK+3
NUSASH
NUSHSAKK+3
NUSASH
NUSHSAKK+3
NUSASH
NUSHSAKK+3
Accessibility
- The image needs an
altnaming the person; the fallback shows only when the image is missing or still loading. - In a group, name the people in the text around it, or give the group an
aria-label.
API reference
The parts of Base UI's Avatar:
| Part | Notes |
|---|---|
Avatar | size: "sm" | "default" | "lg" | "xl"; avatarVariants({ size }) returns its classes |
AvatarImage | src, alt, onLoadingStatusChange |
AvatarFallback | delay before it shows |
AvatarGroup, AvatarGroupCount | <div> and <span> |