WlAvatarGroup

A list of visible avatars with a count of remaining participants.
Components / Data v1.4.0

Size and density

Set max to limit the displayed avatars. Assistive technology can read the names of the remaining participants.

  • AP
  • LW
  • Other participants Dara Martin, Ken Silva
Full example
<WlAvatarGroup
  :items="items"
  :max="2"
  label="Project team"
  
/>

Limits

  • AP
  • LW
  • Other 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
  • Other 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>