Menu

Avatar group

Stacked avatars. 3 sizes.

NJIJRS+2

Installation

$ npx uix-ui@latest add avatar-group

This copies the file into components/ui/avatar-group.tsx in your project. npx shadcn@latest add @uix/avatar-group works too.

Usage

avatar-group.tsx
import { AvatarGroup } from "@/components/ui/avatar-group";

<AvatarGroup max={3}>
  <Avatar initials="NJ" />
  <Avatar initials="IJ" />
  <Avatar initials="RS" />
  <Avatar initials="TA" />
  <Avatar initials="SR" />
</AvatarGroup>

Props

PropTypeDefaultDescription
sizesm | md | lg"md"
maxnumber–Show this many avatars, then a +N bubble.
countReact.ReactNode–Text of the bubble when you count the rest yourself, for example "+5".

Everything else is passed to the root element, so className, aria-* and event handlers work as usual.

Dependencies

Installed for you by the CLI.

  • class-variance-authority
  • clsx
  • tailwind-merge
  • lib/utils.ts
esc

↑↓ to navigate · ↵ to select · esc to close