Avatar List
January 30, 2025Interactive avatar list with horizontal or vertical layout, support for custom sizes, and smooth hover animations powered by Gsap. Perfect for showcasing users or profiles
Features
- Interactivity
- Smooth animations
- Easy configuration
- Reusability
API Reference
Prop | Default | Type | Description |
---|---|---|---|
as | ’div’ | string | HTML element used to render each avatar (e.g. a , div ) |
data | [] | AvatarItem[] | List of avatars with name , src , and alt |
direction | ’horizontal’ | 'horizontal' | 'vertical-right' | 'vertical-left' | Direction of the avatars |
size | ’medium’ | 'small' | 'medium' | Avatar size |
shape | ’circle’ | 'circle' | 'rounded' | Avatar shape |
nameStyles | - | string | Additional classes for the avatar name |
imageStyles | - | string | Additional classes for the image |
Usage
Type: AvatarItem[]
---
import { AvatarList, type AvatarItem } from "@butter-js/ui";
const example: AvatarItem[] = [
{
name: "Three.js",
src: "https://...",
alt: "Three.js Logo"
},
//...
];
---
Examples
Vertical
In this example, Tailwind classes were added, and the direction of the avatars changed to vertical
Blog
This would be an example of how it could look in a blog