Avatar Stack

Avatar Stack is a component that allows you to stack and overlap avatars.

Installation

npx love-ui@latest add avatar-stack

Usage

import { AvatarStack } from "@/components/avatar-stack"
import { Avatar, AvatarImage, AvatarFallback } from "@/components/ui/avatar"
<AvatarStack>
  <Avatar>
    <AvatarImage src="/avatar1.jpg" />
    <AvatarFallback>JD</AvatarFallback>
  </Avatar>
  <Avatar>
    <AvatarImage src="/avatar2.jpg" />
    <AvatarFallback>SM</AvatarFallback>
  </Avatar>
  <Avatar>
    <AvatarImage src="/avatar3.jpg" />
    <AvatarFallback>KL</AvatarFallback>
  </Avatar>
</AvatarStack>

Features

  • Stack and overlap avatars
  • Customize the appearance with className
  • Optional hover animation to expand spacing
  • Configurable avatar size

Examples

With hover animation

Props

AvatarStack

PropTypeDefaultDescription
childrenReactNode-Avatar components to stack
classNamestring-Additional CSS classes
animatebooleanfalseEnable hover animation to expand spacing
sizenumber40Size of each avatar in pixels