Componentdata0.51 KB gzipZero dependencies
Avatar Group
Overlapping avatar stack with +N overflow chip that fans out on hover.
Preview
Live Preview
Installation
Tokens guide →Add to your project via CLI (zero dependencies, code you own):
npx bigbullui add avatar-groupOr install the full npm package:
npm install bigbulluiUsage
tsx3 lines
import { AvatarGroup } from "@/components/ui/avatar-group"; <AvatarGroup names={["Ada", "Grace", "Linus"]} max={3} />Source code
avatar-group.tsx + 1 helperZero 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 />| Prop | Type | Description |
|---|---|---|
| names | string[] | Member names to render initials from. |
| max | number | Avatars before the +N chip (default 3). |
| size | "sm" | "default" | "lg" | Avatar size preset. |
| className | string | Optional Tailwind or custom CSS classes merged with component styles. |