bearnie

Avatar

User profile images with fallback initials.

UserMA

Installation

npx bearnie add avatar
npx bearnie add avatar

Usage

import {
  Avatar,
  AvatarImage,
  AvatarFallback,
} from "@/components/bearnie/avatar"
<Avatar>
  <AvatarImage src="/images/avatars/user.png" alt="User" />
  <AvatarFallback>MA</AvatarFallback>
</Avatar>

Examples

Sizes

SMMDLG

With fallback

UserJD

Avatar group

MikeMAJDABCD

Avatar group with max

MikeMAJDABCDEF

Anatomy

  • Avatar - The root container with size variants
  • AvatarImage - The profile image
  • AvatarFallback - Displayed when image fails to load
  • AvatarGroup - Groups avatars with optional max limit

Props

Avatar

Prop Type Default Description
size sm | default | lg default Avatar size
class string - Additional CSS classes

AvatarImage

Prop Type Default Description
src string required Image source URL
alt string required Alt text for accessibility
class string - Additional CSS classes

AvatarFallback

Prop Type Default Description
class string - Additional CSS classes

AvatarGroup

Prop Type Default Description
max number - Maximum avatars to show before overflow indicator
size sm | default | lg default Size for overflow indicator
class string - Additional CSS classes