All components
Chewypixel component

Avatar Group

Overlapping avatars with a +N count once there are more than fit.

SHEAMT
SHE+3

Installation

npx shadcn@latest add @chewypixel/avatar-group

Usage

import { Avatar, AvatarFallback, AvatarImage } from "@/components/ui/avatar";
import { AvatarGroup } from "@/components/ui/avatar-group";

const members = [
  { name: "Sally Howe", image: "/avatars/sally.png" },
  { name: "Hunter Murazik", image: "/avatars/hunter.png" },
  { name: "Emma Will", image: "/avatars/emma.png" },
  { name: "Angel Lang", image: "/avatars/angel.png" },
  { name: "Myah Adams", image: "/avatars/myah.png" },
];

export function Members() {
  return (
    <AvatarGroup max={4}>
      {members.map((member) => (
        <Avatar key={member.name}>
          <AvatarImage src={member.image} alt={member.name} />
          <AvatarFallback>{member.name[0]}</AvatarFallback>
        </Avatar>
      ))}
    </AvatarGroup>
  );
}

Props

max

The most items to show, counting the +N. Leave it out to show everyone.

number

className

Classes for the row. Each avatar is 32px with a ring in the background color; override with *: classes.

string

Released under the MIT License.

More components

See them in a real app

These components come from Bubblegum, our messenger template built with Next.js, shadcn/ui and Motion.