Skip to content
Okaapiأوكابي
Framework for the code
Theme
Okaapi on GitHub

Chapter 09 Labels

Avatar group

Several people in a small space: the first few avatars overlap and a '+3' stands for the rest. The group has a name, every avatar is still named, and '+3' is read as '3 more'.

Use it in Angular
import { AvatarGroupComponent } from '@okaapi-ui/angular';

A team

H‌M M‌I I‌H +2
Angular
<ui-avatar-group label="Kitchen team" [people]="people" [max]="3" />

people = [{ name: 'Hatem Mohamed', src: '/hatem.jpg' }, { name: 'Mohamed Ibrahim' }, …];

In Arabic

Translate the '+n' name with moreLabel.

ح‌م م‌إ +1
Angular
<ui-avatar-group label="فريق المطبخ" [people]="people" [max]="2" [moreLabel]="more" />

more = (count: number) => `${count} آخرون`;

When to use something else

If you needUse
One personAvatar
Every name visible, such as a list of attendeesA list or Data table

Inputs

NameTypeDefaultWhat it does
labelstring — Required. Who the group is, for screen readers.
peopleAvatarPerson[] — Required. { name, src? } for each person, in order.
maxnumber4How many avatars to show before "+n".
size'sm' | 'md' | 'lg''md'Size of every avatar.
moreLabel(count: number) => string(n) => `${n} more` from labelsThe spoken name of "+n". Translate it.

Keyboard and screen readers

  • The group has a name, every avatar is still named, and +3 is read as 3 more.