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 playgroundAbout
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
npm i @ashutoshswamy/smouiUsage
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.
numberdefault4- AvatarGroup size / overlap
Avatar size in px and how far each tucks under the next (0 to 0.6).
numberdefault40 / 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
More cards components
- BadgeA short status label in five tones, soft or solid, with an optional icon. A number inside rolls to its new value.
- BookingCardPick a day, pick a time, book. One pill slides between choices and the button names what you are about to book.
- CartSummaryA small basket. Each row opens its Add button into a stepper, and the subtotal rolls digit by digit up or down with every change.
- CommentThreadA conversation that reads as one. Replies hang off a thin rail and fold away, likes count as they change, and the reply box opens in place and grows as you type.
- CompareStatThis period against the last. Totals and the change on top, paired bars below; point at a pair and the caption names both numbers.
- ContactCardA card that turns over on a spring. The front is who they are; the back is how to reach them, and each line copies on a press.