Skip to content

Avatar Group

Data displaySince 0.9.0

A row of overlapping avatars for the people on a record, with the overflow collapsed into “+N”. AvatarGroup is a named group: each avatar is named by its person (see Avatar), and the overflow chip is announced as “N more”. Size and shape follow the Avatar configuration unless set on the group.

  • Stacked avatarsOverlapping avatars for teams, reviewers, or watchers.
  • Overflow chipBeyond the maximum, a +N chip stands for the remaining people.
  • One accessible groupThe group has a label and every person keeps a name.
  • Shared size and shapeSize and shape apply to every avatar in the group.

Use it for

  • Members, assignees, or viewers of a record, project, or document.
  • Compact presence of several people in a header or card.

Use something else for

  • One person: use Avatar.
  • A list the user must read in full or act on: use a list or a table.
Anatomy
<div class="aui-avatar-group" role="group" aria-label="Project members">
<span class="aui-avatar ..." role="img" aria-label="Ada Lovelace">...</span> (up to max)
<span class="aui-avatar aui-avatar-group__more" role="img" aria-label="2 more">
<span class="aui-avatar__visual" aria-hidden="true">+2</span>
</span>
</div>

Use the bar above each frame to switch theme, density, direction, and locale.

The part of the Team profile showcase that uses Avatar Group. Change its options, use it with the keyboard, and watch the event log; the link in the frame opens the full showcase. The bar above the frame switches theme, density, direction, and locale.

Showcase source
// Layout and content showcase: a team profile page built with the layout primitives, cards,
// typography, badges, keyboard keys, avatars, an avatar group, and a tag group.
import { Avatar } from '@absoluteui/components/avatar';
import { AvatarGroup } from '@absoluteui/components/avatar-group';
import { Badge } from '@absoluteui/components/badge';
import { Card } from '@absoluteui/components/card';
import { Kbd } from '@absoluteui/components/kbd';
import { Container, Divider, Flex, Grid, Stack } from '@absoluteui/components/layout';
import { TagGroup, type TagGroupChangeDetail } from '@absoluteui/components/tag-group';
import { Heading, Link, Text } from '@absoluteui/components/typography';
import { annotate, choice, createShowcase, hostIn, toggle } from './kit.js';
const sc = createShowcase({
title: 'Team profile',
description: 'Layout primitives and content components composing a real page. Resize the frame: the grid reflows.',
});
const page = hostIn(sc.stage);
Container.apply(page, { size: 'lg' });
const stack = Stack.apply(page, { gap: 6 });
// Each block of the page declares its components (focus mode shows a component's own blocks).
// Header.
const header = annotate(hostIn(page), ['layout', 'avatar', 'typography', 'badge']);
const headerFlex = Flex.apply(header, { gap: 4, align: 'center', wrap: true });
const avatar = Avatar.create(hostIn(header), { name: 'Platform Engineering', size: 'xl', shape: 'square', icon: 'code' });
const titles = hostIn(header);
Stack.apply(titles, { gap: 1 });
titles.append(Heading.create(2, 'Platform Engineering', { size: 3 }), Text.create('Builds and runs the internal developer platform.', { tone: 'muted' }));
const badges = hostIn(titles);
Flex.apply(badges, { gap: 2, wrap: true });
const badgeList = [
Badge.create(hostIn(badges), { label: 'Hiring', tone: 'success', dot: true }),
Badge.create(hostIn(badges), { label: '14 members', tone: 'neutral' }),
Badge.create(hostIn(badges), { label: 'On call', tone: 'warning', variant: 'outline', icon: 'clock' }),
];
// Members grid of cards.
const members = annotate(hostIn(page), ['layout', 'card', 'avatar', 'typography']);
Stack.apply(members, { gap: 4 });
members.append(Divider.create({ label: 'Members' }));
const grid = hostIn(members);
const gridLayout = Grid.apply(grid, { columns: 'auto', minColumnWidth: '14rem', gap: 4 });
const MEMBERS = [
{ name: 'Ada Kowalski', role: 'Engineering lead', status: 'online' },
{ name: 'Bruno Silva', role: 'Site reliability', status: 'busy' },
{ name: 'Chen Wei', role: 'Backend engineer', status: 'away' },
{ name: 'Divya Nair', role: 'Frontend engineer', status: 'offline' },
] as const;
const cards = MEMBERS.map((m) => {
const content = document.createElement('div');
Flex.apply(content, { gap: 3, align: 'center' });
Avatar.create(hostIn(content), { name: m.name, status: m.status, size: 'md' });
const who = document.createElement('div');
who.append(Text.create(m.name, { strong: true }), Text.create(m.role, { tone: 'muted', size: 'sm' }));
content.append(who);
return Card.create(hostIn(grid), { content, variant: 'raised', headingLevel: 3 });
});
// Skills and shortcuts.
const details = hostIn(page);
Grid.apply(details, { columns: 'auto', minColumnWidth: '16rem', gap: 4 });
const skillsBody = document.createElement('div');
const tags = TagGroup.create(hostIn(skillsBody), {
label: 'Team skills',
removable: true,
selection: 'multiple',
value: ['kubernetes'],
items: [
{ value: 'kubernetes', label: 'Kubernetes' },
{ value: 'terraform', label: 'Terraform' },
{ value: 'go', label: 'Go' },
{ value: 'observability', label: 'Observability' },
{ value: 'security', label: 'Security' },
],
});
annotate(Card.create(hostIn(details), { title: 'Skills', content: skillsBody, headingLevel: 3 }).host, ['layout', 'card', 'tag-group']);
const shortcutsBody = document.createElement('dl');
shortcutsBody.className = 'sc-shortcuts';
for (const [keys, text] of [
['Mod+K', 'Search'],
['Mod+Shift+P', 'Command palette'],
['?', 'Show shortcuts'],
] as const) {
const dt = document.createElement('dt');
Kbd.create(dt, { hotkey: keys });
const dd = document.createElement('dd');
dd.textContent = text;
shortcutsBody.append(dt, dd);
}
annotate(Card.create(hostIn(details), { title: 'Shortcuts', content: shortcutsBody, headingLevel: 3 }).host, ['layout', 'card', 'kbd']);
const footer = annotate(hostIn(page), ['layout', 'avatar-group', 'typography']);
Flex.apply(footer, { gap: 3, align: 'center', justify: 'between', wrap: true });
const group = AvatarGroup.create(hostIn(footer), { label: 'Recently active', max: 4, items: ['Ada Kowalski', 'Bruno Silva', 'Chen Wei', 'Divya Nair', 'Emeka Obi', 'Farah Haddad', 'Grace Liu'].map((name) => ({ name })) });
footer.append(Link.create({ href: 'https://example.com/platform', text: 'Team handbook', external: true }));
sc.listen(tags.host, ['aui-change', 'aui-remove'], 'tags');
tags.host.addEventListener('aui-change', (e) => {
sc.log('selected skills', (e as CustomEvent<TagGroupChangeDetail>).detail.value);
});
choice(
sc,
'Spacing',
[
{ value: '4', label: 'Compact' },
{ value: '6', label: 'Comfortable' },
{ value: '10', label: 'Spacious' },
],
'6',
(g) => {
const gap = Number(g) as 4 | 6 | 10;
stack.update({ gap });
gridLayout.update({ gap: gap === 10 ? 8 : 4 });
headerFlex.update({ gap: gap === 10 ? 6 : 4 });
},
['layout'],
);
choice(
sc,
'Avatar shape',
[
{ value: 'square', label: 'Square' },
{ value: 'circle', label: 'Circle' },
],
'square',
(shape) => {
avatar.update({ shape });
group.update({ shape });
},
['avatar', 'avatar-group'],
);
toggle(sc, 'Outline badges', false, (outline) => {
for (const b of badgeList) b.update({ variant: outline ? 'outline' : 'subtle' });
}, ['badge']);
toggle(sc, 'Sunken cards', false, (sunken) => {
for (const c of cards) c.update({ variant: sunken ? 'sunken' : 'raised' });
}, ['card']);
import { AvatarGroup } from '@absoluteui/components/avatar-group';
const host = document.createElement('div');
document.body.append(host);
AvatarGroup.create(host, {
label: 'Project members',
items: [
{ name: 'Ada Lovelace', status: 'online' },
{ name: 'Grace Hopper' },
{ name: 'Alan Turing', status: 'away' },
{ name: 'Barbara Liskov' },
{ name: 'Edsger Dijkstra' },
{ name: 'Donald Knuth' },
],
max: 4,
});
Terminal window
npm install @absoluteui/components @absoluteui/core @absoluteui/theme

Registry setup, the theme stylesheet, and the Content Security Policy are covered in Installation.

import { AvatarGroup } from '@absoluteui/components/avatar-group';
import '@absoluteui/components/avatar/style.css';
import '@absoluteui/components/avatar-group/style.css';
import { AvatarGroup } from '@absoluteui/components/avatar-group';
import '@absoluteui/components/avatar/style.css';
import '@absoluteui/components/avatar-group/style.css';
const host = document.querySelector<HTMLElement>('#reviewers');
if (host) AvatarGroup.create(host, { label: 'Reviewers', items: [{ name: 'Barbara Liskov' }, { name: 'Donald Knuth' }], size: 'sm' });
More usage
import { AvatarGroup } from '@absoluteui/components/avatar-group';
const host = document.querySelector<HTMLElement>('#watchers');
if (host) {
const group = AvatarGroup.create(host, { label: 'Watchers', items: [{ name: 'Ada Lovelace' }, { name: 'Grace Hopper' }], max: 3 });
group.update({ items: [...group.options.items, { name: 'Alan Turing', status: 'online' }] });
}

Using Angular? See Avatar Group for Angular.

AvatarGroup.create(host: HTMLElement, options: AvatarGroupOptions): AvatarGroup

Global configuration key: avatarGroup (see Configuration).

Option Type Default Description
label string Accessible name of the group, such as ‘Project members’. Required.
items readonly AvatarGroupItem[] People: { name, src?, icon?, status? }. Required.
max number "4" Avatars shown before the ‘+N’ chip (1 to 50). Globally configurable.
size 'xs' | 'sm' | 'md' | 'lg' | 'xl' Avatar size (default: Avatar configuration).
shape 'circle' | 'square' Avatar shape (default: Avatar configuration).
locale string "en-US" Locale of the overflow count and label. Globally configurable. Inherited from common configuration.
Property Type Description
host HTMLElement The host element (role=group).
overflow number Number of people behind the ‘+N’ chip.
options Readonly<AvatarGroupOptions> Current options.
Method Description
update(options: Partial<AvatarGroupOptions>): void Merge and apply options; an invalid item leaves the previous rendering intact.
destroy(): void Destroy the avatars and remove rendering, attributes, classes, and subscriptions.

All rules live in the aui.components cascade layer, so application styles override them without specificity battles.

Class Purpose
aui-avatar-group Host (role=group).
aui-avatar-group__more The ‘+N’ overflow chip (an aui-avatar sized like the others).

Tokens this stylesheet reads (verified in CI). Override them in a theme or with the Theme Designer.

--aui-border-width | --aui-color-border-strong | --aui-color-surface | --aui-color-text

TypeScript definitions
interface AvatarGroupConfig { max: number }
interface AvatarGroupItem { name: string; src?: string | null; icon?: IconRef | null; status?: AvatarStatus | null }
interface AvatarGroupOptions extends Partial<AvatarGroupConfig> {
label: string;
items: readonly AvatarGroupItem[];
size?: AvatarSize;
shape?: AvatarShape;
locale?: string;
}

Pattern: Named group of images: role=group with aria-label; each avatar is role=img named by its person; the overflow chip is role=img named ‘N more’.

Checked on every docs build: the showcase passes axe (WCAG 2.2 A and AA rules) in the default, dark, and high-contrast themes and right to left; the playground loads without errors and passes axe before and after every on/off option is switched, with no Content Security Policy violations.

Key Context Action
None Any Not focusable; read in document order by assistive technology.
Element Role
host group
avatar img
overflow chip img
Attribute Element Value
aria-label host the label option
aria-label overflow chip ‘{count} more’ (localized)

Never receives or moves focus.

Criterion Level Note
1.1.1 Non-text Content A
1.3.1 Info and Relationships A
1.4.3 Contrast (Minimum) AA
1.4.11 Non-text Contrast AA

Automated test results: Accessibility and compliance.

  • The overflow chip says how many people are not shown; provide the full list elsewhere when users need the names.
  • Manual screen-reader verification (NVDA, JAWS, VoiceOver) is pending.
Import cost Minified gzip brotli CSS brotli
@absoluteui/components/avatar-group 36.4 kB 12.5 kB 11.1 kB 0.3 kB

Measured at build time, including every AbsoluteUI module the component pulls in. No third-party runtime dependencies.

Budget (enforced in CI) Limit
AvatarGroup.create with 6 items, max 4 < 2 ms average in headless Chromium

Tested scale: Up to 10,000 items accepted; at most max (up to 50) avatars are rendered.

At most max avatars are created per render; the rest are counted.

Measured run times: Performance.

States

Within max (every avatar shown); overflow (max avatars and the “+N” chip).

State transitions
From Trigger To
any update({ items, max }) avatars re-created; chip shown when items exceed max
any Avatar or Avatar Group configuration change re-rendered with the new size, shape, max, or locale
any destroy() host restored to empty
Accessibility notes
  • The chip says how many people are not shown, not who they are. Provide the full list elsewhere (for example in a dialog opened by a nearby button) when users need the names.
  • The e2e axe run covers three themes; manual screen-reader verification is pending.
Responsive behavior

An inline row in which avatars overlap by a quarter of their size; it does not wrap. Lower max for narrow containers.

Right-to-left

Order and overlap follow the inline direction.

Theming

Avatar tokens apply to every avatar. Forced-colors mode removes the surface rings; each avatar draws a CanvasText boundary.

Global configuration
configureAbsoluteUI({ components: { avatarGroup: { max: 3 }, avatar: { size: 'sm' } } });
Component configuration

Instance max, size, shape, and locale override configuration; configuration changes re-render existing groups.

Icons

Per item icon, as in Avatar.

Security

Every item is validated as Avatar options: unsafe image sources throw AVATAR_OPTIONS. Names and counts are rendered with textContent.

Data handling

Only the avatars’ image elements load their src, without a referrer. No persistence, other network access, or telemetry.

Supported data scale

Up to 10,000 items are accepted; up to 50 avatars are rendered.

Edge cases
  • An empty items array renders an empty group.
  • When items exceed max, exactly max avatars are shown, followed by the chip.
  • Safe in renderers that discard nodes without calling destroy(), such as Data Table cells: the configuration subscription holds the instance weakly, so a discarded group is released.
Errors
Code Category Cause
AVATAR_GROUP_OPTIONS configuration Missing or blank label, or items that are not an array (or more than 10,000).
AVATAR_OPTIONS configuration An invalid item (blank name, unsafe src, unknown status).
CFG_INVALID_VALUE / CFG_UNKNOWN_OPTION configuration Invalid max, size, shape, or locale configuration.

Invalid options throw before the host is modified; an invalid update() leaves the previous rendering intact.

Known limitations
  • The people behind “+N” are not listed.
  • Every update re-creates the shown avatars.
Unsupported scenarios
  • Clickable avatars or chip: put a button next to the group that opens the full list.
  • Wrapping onto several lines.