Avatar Group

A component that displays a group of avatars with optional overlapping, tooltips, and ring effects.

Avatar
User 1
Avatar
User 2
Avatar
User 3
Avatar
User 4
Avatar
User 5

Installation

1. Dependencies

npm install clsx tailwind-merge

2. Paste inside @/lib/utils.ts

import { clsx } from "clsx";
import { twMerge } from "tailwind-merge";

export function cn(...inputs: Parameters<typeof clsx>) {
  return twMerge(clsx(...inputs));
}

3. Copy Avatar Group Code

Loading...

Copy Avatar Group Code

AvatarGroup Props

NameTypeRequiredDefaultDescription
imgsstring[]YesundefinedArray of image URLs for the avatars.
sizenumberNo32Size of the avatars in pixels.
spacingnumberNo14Spacing between the avatars in pixels.
maxnumberNoundefinedMaximum number of avatars to display.
ringbooleanNofalseWhether to show a ring around the avatars.
overlapbooleanNofalseWhether to overlap the avatars.
tooltipsbooleanNofalseWhether to show tooltips on hover.