Avatars
An Avatar can take on many responsibilities and can be used in most any other component.
Letter avatars
Avatars containing simple characters can be created by passing your string as children
.
Image Avatars
Image avatars can be created by passing standard img
props src
or srcSet
into the component.
Follow alternative text guidelines depending on if your image avatar is decorative or functional.
Image fallbacks
If the image link is invalid, the component gracefully falls back to using either the first letter from the alt attribute or alternatively you can supply an icon to use.
Icon Avatars
Icon avatars are created by passing an icon as children
.
Use icon avatars only for decorative purposes. Review Icons for functional iconography usage.
Avatar Sizes
There are four sizes available for Avatar
as well as the ability to pass an object to the size
prop defining width
, height
, or both.
Note: medium
is the default size
value if no other size is defined.
Shape variants
The default shape is variant='circle'
but alternatives exist for square
and rounded
.