Avatars represent users within an application and add familiarity when used alongside the user’s name.
Default avatar
The default avatar is 32px round with a 2px “border.” For placeholder avatars, the border is actually an inset box shadow with 12.5% opacity; this allows the border to darken whatever the background color is. For images, the border is an actual white border.
Sizes
Six sizes are available for avatars: small (24px), default (32px), header (40px), medium (48px), large (80px), and profile (144px). Small and default should be used pretty much every time, unless there is a specific reason to go for a larger size.
Colors
Set the background color of a placeholder avatar using any of the Tailwind (or your own framework’s) background color classes. Honeycomb also supports some convenience classes using our palette, with a .hc-avatar--dark modifier to darken the color.
The dark colors change the placeholder text to white, or you cans et this manually with .hc-avatar--contrast.
Images
Add an image inside of the .hc-avatar instead of text and apply a class .hc-avatar-image to it for automatic handling. Make sure the image is large enough to fit inside of the size you choose.
Stacked groups
Use stacked groups of avatars when you need to display more than over avatar and/or you need to indicate that multiple users are involved.
For more than 4 avatars, the 4th should instead be a placeholder avatar with the count of additional avatars in the stack.
With Indicators
Use indicators overlayed on an avatar to signal a status for that user. The convenience class .hc-avatar--with-indicator should be used for a wrapping element and you do not need to add a position class to the indicator; they are required to be top right and this is handled automatically for avatars.