Avatar

@sushindustries/ui

A person at glyph size: the image if it loads, initials on a toned fill if it does not.

5 min read
View as MarkdownEdit on GitHub

Props

PropTypeDefaultDoes
src?string-Image URL. Absent or failed, the initials take over.
namestring-The person's name; the alt text and the source of the initials.
size?number32Pixel size.
tone?string-Colour family for the initials fill.

AvatarGroupProps

PropTypeDefaultDoes
peoplereadonly Pick<AvatarProps, "name" | "src" | "tone">[]-In display order; the first renders on top.
max?number4How many faces before the count takes over.
size?number32Pixel size of every face, the overflow count included.

Notes

AvatarGroup's people accepts name, src and tone only - any other field on a source object (an id, a role) is not read by this component and should stay in the array the host maps from rather than being passed through. max clamps the visible faces but never removes anyone from the overflow count; passing max={0} renders only the "+N" badge, with every person folded into it.