Avatar
A circular user image with automatic fallback to colored initials when no src is given or the image fails to load.
Playground
JD
<Avatar
initials="JD"
width={40}
height={40}
status="online"
/>
Initials
JD
AK
RS
MP
<Avatar initials="JD" />
<Avatar initials="AK" />
Sizes
XS
SM
MD
LG
XL
<Avatar initials="SM" width={32} height={32} />
<Avatar initials="LG" width={56} height={56} />
Image with fallback
<Avatar src="https://i.pravatar.cc/150?img=12" initials="JD" />
Status indicator
A small presence dot, positioned at the bottom-right corner.
ON
OF
AW
BU
<Avatar initials="ON" status="online" />
<Avatar initials="BU" status="busy" />
Grouped avatars
AvatarGroup stacks and overlaps its Avatar children, sizing them consistently, with an optional max to cap how many show before a "+N" overflow avatar.
JD
AK
RS
+2
<AvatarGroup max={3}>
<Avatar initials="JD" />
<Avatar initials="AK" />
<Avatar initials="RS" />
<Avatar initials="MP" />
<Avatar initials="TL" />
</AvatarGroup>
Props
Avatar
| Prop | Type | Default | Description |
|---|---|---|---|
initials | string | Required. Fallback text shown when there is no image or it fails to load; only the first two characters are used, uppercased. | |
src | string | URI of the network image to display. | |
width | number | 40 | Width of the avatar in pixels. |
height | number | 40 | Height of the avatar in pixels. |
imageProps | Omit<ImageProps, 'source' | 'style'> | Additional props forwarded to the underlying Image. | |
status | 'online' | 'offline' | 'away' | 'busy' | Renders a presence dot at the bottom-right corner. | |
statusColor | TVajraColors | Overrides the status dot's color token instead of the default status→tone mapping. |
AvatarGroup
| Prop | Type | Default | Description |
|---|---|---|---|
children | ReactNode | Required. Avatar elements to stack. | |
size | number | 40 | Diameter (px) used to size each Avatar child consistently. |
overlap | number | size * 0.3 | How much each avatar overlaps its neighbor, in px. |
max | number | Caps the number of avatars shown, rendering a "+N" overflow avatar for the rest. |