Avatar
An image element with a fallback for representing a user.
Usage
AR
Composition
code
Avatar
├── AvatarImage
├── AvatarFallback
└── AvatarBadge (optional status dot or icon)
Prefer the prop API for typical avatars. Compose manually when you need custom markup:
AR
Status dot
Use dot for an online-style indicator, or compose avatar-badge yourself.
AR
JD
CN
Badge with icon
PP
Sizes
SM
DF
LG
Group
A
B
C
+3
API Reference
Avatar
| Prop | Type | Default | Description |
|---|---|---|---|
size |
default | sm | lg |
default |
Avatar diameter |
src |
string |
— | Image URL (composes avatar-image) |
alt |
string |
"" |
Image alt text |
fallback |
string |
— | Fallback initials when image is missing/broken |
dot |
bool | success | warning | destructive | info | primary | muted |
— | Status indicator at the end-bottom corner (true = success) |
as |
string |
span |
Root HTML element |
Parts
avatar-image, avatar-fallback, avatar-badge, avatar-group, and avatar-group-count accept as and HTML attributes.