Avatar Group

Overlapping avatars with one shared tooltip that hands off between faces.

avatar-group.tsx

Installation

1

Install the packages

npm install @prequelui/react motion

@prequelui/react reuses the primitive library your components already depend on.

2

Add the component

npx shadcn@latest add https://animate.prequelui.terravidhal.me/r/avatar-group.json

npx shadcn@latest add https://animate.prequelui.terravidhal.me/r/avatar-group.json

3

Turn on the motion

npx @prequelui/cli@latest animate avatar-group

The CLI finds the component through components.json, swaps the import and removes the CSS animation classes that Motion replaces.

Usage

Import the component and compose it exactly like the primitive it wraps. Motion is enabled by default; the tempo prop scales every duration and softens every spring.

avatar-group.tsx
import {
  AvatarGroup,
  AvatarGroupItem,
} from "@/components/prequelui/avatar-group";

export default function Demo() {
  return (
    <AvatarGroup>
      <AvatarGroupItem name="Mina" />
      <AvatarGroupItem name="Theo" />
      <AvatarGroupItem name="Iris" />
      <AvatarGroupItem name="Noé" />
    </AvatarGroup>
  );
}
import { AvatarGroup } from "@/components/prequelui/avatar-group";

export function Variant() {
  return (
    <AvatarGroup tempo={1.2}>
      …
    </AvatarGroup>
  );
}

Animation

Hovering a face lifts it by thirty percent of its height while one shared tooltip glides to that face. Moving across the row hands the tooltip over instead of closing and reopening it, so the row feels like one object.

  • Avatar lift: spring 300 / 17, the bounciest value in the library.
  • Tooltip: spring 400 / 29 and a horizontal handoff, not a remount.
  • The tooltip stays mounted while any avatar in the group is hovered.
  • Overlap is 12 px; `invertOverlap` flips the stacking order.
  • Reduced motion removes the lift and keeps the label change.
spring 300 / 17lift 30%tooltip 400 / 29handoff

API Reference

Each part accepts the usual HTML props in addition to the motion props below. No accessibility prop is hidden behind the animation layer.

AvatarGroup

PropTypeDefault
invertOverlapbooleanfalse
tooltipSideOffsetnumber8
classNamestring—

AvatarGroupItem

PropTypeDefault
namestring—
srcstring—
childrenReactNodeinitials
classNamestring—

Built by Vidhal. The source is available on GitHub.

Last updated: 11/17/2026