Skip to content
v0.2.10

AvatarGroup

A compact collection of avatars with an accessible overflow count.

Preview
  • +1

Use AvatarGroup

AvatarGroup is a named export of @flood-md/react. Connect the package once, then import what you use.

First time here? Connect Flood
Example import style
avatar-group.tsxTSX
"use client";

import { FloodRoot, AvatarGroup } from "@flood-md/react";
import "@flood-md/react/styles.css";

export function Example() {
  return (
    <FloodRoot>
      <AvatarGroup label="Project collaborators" items={[{id:"alex",name:"Alex Morgan"},{id:"sam",name:"Sam Lee"},{id:"june",name:"June Park"}]} max={2} />
    </FloodRoot>
  );
}

Design notes

  • The native list composes Flood Avatar. IDs and names must be nonempty and unique IDs remain stable. max is a positive integer; the default shows four people.
  • Overflow is a static count, not a hidden interactive menu. Translate overflowLabel when needed; visible avatars retain their individual accessible names. Size follows Avatar. Intentional overlap never applies to interactive targets.
  • Compatible addition in 0.2.5. Uses existing Flood semantic tokens and relative geometry.

API reference

PropValuesDefault
itemsreadonly AvatarGroupItem[]Required
labelstringRequired
maxnumber4
size"sm" | "md" | "lg""md"
overflowLabelstring—
Native HTML propsOmit<HTMLAttributes<HTMLUListElement>, "children">Forwarded
View TypeScript source