UI Toolbox logoUI Toolbox

AvatarGroup

An AvatarGroup is a row of UserAvatars that overlap. With a maximum, it shows the first avatars and a "+N" count for the rest.

Four avatars that overlap, with a +2 count at the end

How to show the members of a team:

<tb:AvatarGroup name="team" max="3">
    <tb:UserAvatar display-name="Ada Lovelace" />
    <tb:UserAvatar display-name="Grace Hopper" />
    <tb:UserAvatar display-name="Alan Turing" />
    <tb:UserAvatar display-name="Linus Torvalds" />
    <tb:UserAvatar display-name="Margaret Hamilton" />
</tb:AvatarGroup>
var team = root.Q<AvatarGroup>("team");
team.Add(new UserAvatar { DisplayName = "Katherine Johnson" });
team.Refresh();
Member Description
Max (max) The most avatars to show. The rest shows as a "+N" count. 0 (the default) shows all avatars.
Refresh() Shows the first Max avatars and the count again. Call it after you add or remove an avatar from code.

Tips:

Styling

Class Element
tb-avatar-group The row. Each child overlaps the child before it by 8 px.
tb-avatar-group__more The count: a circle in --tb-color-surface-alt with bold small text. Hidden when all avatars show.
.tb-avatar-group .tb-avatar__image,
.tb-avatar-group__more { border-color: var(--tb-color-background); }