Componentdata0.51 KB gzipZero dependencies

Avatar Group

Overlapping avatar stack with +N overflow chip that fans out on hover.

Preview

Live Preview
Open ↗

Installation

Tokens guide →

Add to your project via CLI (zero dependencies, code you own):

npx bigbullui add avatar-group

Or install the full npm package:

npm install bigbullui

Usage

tsx3 lines
import { AvatarGroup } from "@/components/ui/avatar-group"; <AvatarGroup names={["Ada", "Grace", "Linus"]} max={3} />

Source code

avatar-group.tsx + 1 helper

Zero third-party dependencies (2 local files shown in tabs below).

tsxavatar-group.tsx67 lines
"use client"; import * as React from "react";import { cn } from "./lib/utils"; export type AvatarGroupProps = {  names?: string[];  max?: number;  size?: "sm" | "default" | "lg";  className?: string;}; const Avatar = ({ className, ...props }: React.HTMLAttributes<HTMLDivElement>) => (  <div className={cn("rounded-full w-6 h-6 flex items-center justify-center font-medium text-xs", className)} {...props} />); const AvatarGroup = React.forwardRef<HTMLDivElement, AvatarGroupProps>(  ({ names = [], max = 3, size = "default", className }, ref) => {

Props

Interactive Prop Playground

Tweak parsed AST props below to generate ready-to-paste JSX.

tsx3 lines
import { AvatarGroup } from "@/components/ui/avatar-group"; <AvatarGroup />
PropTypeDescription
namesstring[]Member names to render initials from.
maxnumberAvatars before the +N chip (default 3).
size"sm" | "default" | "lg"Avatar size preset.
classNamestringOptional Tailwind or custom CSS classes merged with component styles.