Avatar
An avatar is used to represent a user, team or another entity.
Usage
Local Image
An avatar can display a local image.
Remote image
An avatar can fetch a remote image.
Fallback image
A fallback image can be set in case the src
fails to load.
Loading Failure
When an image fails to load, a default image will be displayed.
Double Failure
When the fallback image fails to load, a default image will be displayed.
Src and Fallback Bypass
If no fallback image is provided and the image fails to load, the initials will be displayed instead.
Anonymous
An anonymous avatar can be displayed.
Deleted
A deleted avatar can be displayed.
Broken
A broken avatar can be displayed.
Sizes
An avatar can be displayed in different sizes.
Disabled
An avatar can be disabled.
Customize the image props
Using a custom hook to retry loading the image up to 5 times with a 250ms delay.
AvatarGroup
An avatar group can be used to display multiple avatars.
Too many avatars
When there are too many avatars, a counter will be displayed.
Sizes
An avatar group can be displayed in different sizes.
Max number of avatars
An avatar group can be limited to a maximum number of avatars.
Props
Avatar
The src of the image to display if the image fails to load. If set to null, the initials will be displayed instead.
Props to add to the img element when src is provided.
Whether or not the avatar is disabled.
The name of the Avatar. This will be used for the alt text of the image or the initials if no image is provided.
The size of the avatar.
The src of the image to display. If not provided, the initials will be displayed instead.
The CSS className for the element. A function may be provided to compute the class based on component state.
The inline style for the element. A function may be provided to compute the style based on component state.
AvatarGroup
The size of the avatar.
The maximum number of avatars to show before showing the overflow indicator.
Whether or not to wrap the avatars.
Whether or not to reverse the order of the avatars.
The alignment of the avatars within the AvatarGroup.
The content of the AvatarGroup.
The inline style for the element.
The CSS className for the element.