AvatarGroup

A tucked stack of avatars. Point at one and it lifts, its neighbours part around it and a tooltip names it. The +N chip opens the rest as a list. Cards.

Open playground

About

AvatarGroup is a React component in the Cards category of smoui. It is typed, ships no stylesheet, follows your theme through CSS variables, and honors prefers-reduced-motion. Import it with import { AvatarGroup } from "@ashutoshswamy/smoui" and set AvatarGroup, AvatarGroup, AvatarGroup among its 6 props.

Install

Terminal
npm i @ashutoshswamy/smoui

Usage

TSX
import { Avatar, AvatarGroup, MeshArt } from "@ashutoshswamy/smoui";

<AvatarGroup
  max={4}
  people={[
    { name: "Iris Vale", detail: "Design", status: "online" },
    { name: "Teo Marsh", detail: "Engineering", src: "/teo.jpg" },
  ]}
/>
<Avatar name="Mara Okonkwo" size={48} />
<div className="h-24 w-40"><MeshArt seed="cover" /></div>

Props 6

AvatarGroup people

Members. Without src, a mesh avatar is generated from the name. detail shows in the tooltip and list; status (online, away, busy) adds a presence dot.

{ name; detail?; src?; palette?; status? }[]
AvatarGroup max

Shown before the +N chip.

numberdefault 4
AvatarGroup size / overlap

Avatar size in px and how far each tucks under the next (0 to 0.6).

numberdefault 40 / 0.32
AvatarGroup ringColor

Colour of the gap between avatars. Match the surface behind the group.

string
Avatar name / src / size / palette

Single avatar. Palette 0-7.

string / string / number / number
MeshArt seed / palette

A block of grainy mesh that fills its box: covers, banners, placeholders.

string / number