WlAvatarGroup
Size and density
Set max to limit the displayed avatars. Assistive technology can read the names of the remaining participants.
- AP
- LW
- +2Other participants Dara Martin, Ken Silva
Full example
<WlAvatarGroup
:items="items"
:max="2"
label="Project team"
/>Limits
- AP
- LW
- +2Other participants Dara Martin, Ken Silva
Full example
<WlAvatarGroup
:items="items"
:max="2"
label="Project team"
/>Custom overflow
Show an icon with the remaining count. The component still announces the hidden names to screen readers.
Assigned reviewers
- AP
- LW
- 2Other participants Dara Martin, Ken Silva
Full example
<script setup lang="ts">
import { WlAvatarGroup, type WlAvatarGroupItem, WlIcon } from "legato-ui";
const reviewers = [
{ key: "anna", name: "Anna Petrova", presence: "online" },
{ key: "li", name: "Li Wen", presence: "busy" },
{ key: "dara", name: "Dara Martin" },
{ key: "ken", name: "Ken Silva" }
] satisfies readonly WlAvatarGroupItem[];
</script>
<template>
<div class="wl-stack" data-space="sm">
<p class="wl-text-label">{{ "Assigned reviewers" }}</p>
<WlAvatarGroup
:items="reviewers"
:max="2"
:size="48"
label="Assigned reviewers"
>
<template #overflow="{ count, items }">
<span class="wl-inline" data-space="xs" :title="items.map((item) => item.name).join(', ')">
<WlIcon name="user" :size="16" />{{ count }}
</span>
</template>
</WlAvatarGroup>
</div>
</template>Props
Types, accepted values and literal defaults come from the public manifest. Inherited settings name their source; “Not set” means no default is declared.
| Prop | Type / values | Default | Purpose |
|---|---|---|---|
items * | readonly WlAvatarGroupItem[] | Required | People in display order. |
max | number | Not set | Number of avatars shown before the remaining count. |
size | WlAvatarSize | 32 | Avatar size in pixels. |
label | string | Not set | Accessible name of the group. |
pt | WlPt< | Not set | Attributes for the list, individual items and overflow item. |
Events
No public events.
Slots
| Slot | Type / values | Content |
|---|---|---|
overflow | overflow?(props: { count: number; items: readonly WlAvatarGroupItem[] }): unknown; | Replace the overflow counter's visible content. |
Pass-through: pt
Sections WlAvatarGroup are listed below. Attributes merge in this order: createWlPt() WlConfig.ptpt instance. Class and style merge; the last supplied value takes priority for other attributes.
| Section | DOM | Purpose |
|---|---|---|
root | ul.wl-avatar-group | Main element of the component. |
item | li.wl-avatar-group__item | One repeated item. |
overflow | li.wl-avatar-group__item | Item that represents remaining participants. |
Sections refer to the component DOM. Dotted names identify a configuration group and its section; composite parts use their own pt groups. Global and local attributes merge, with class and style added together.
Keyboard and accessibility
- Set max to limit the displayed avatars. Assistive technology can read the names of the remaining participants.
- Name the group when a page shows several participant lists, such as reviewers and assignees.
- Keep the overflow slot descriptive. The count helps users understand how many participants remain.
Keyboard and application responsibilities
Provide a meaningful accessible name and connect labels, hints and errors to the focusable element. Check the behavior with your own data and a screen reader.
WAI-ARIA Authoring PracticesIn your application, check keyboard controls, zoom and focus visibility. State labels and required information must be readable in every theme.