HelpTribe.

Avatar

User avatar with gradient fallback initials, status indicator, animated ring, and smooth image crossfade. Unique gradient colors generated from initials.

Installation

$ npx shadcn@latest add avatar

Preview

With Images

Felix
Aneka
Maria

Fallback Initials

JD
AB
KZ
?

With Animated Ring

Sarah
HQ

Sizes

XS
SM
MD
LG
XL

Status Indicators

Online

Away

Busy

OF

Offline

Animated Ring

HQ

Usage (React/TSX)

import { Avatar } from "@/components/ui/avatar"

export default function UserCard() {
  return (
    <div className="flex items-center gap-3">
      <Avatar src="/user.jpg" alt="User" fallback="JD" size="md" status="online" />
      <span>John Doe</span>
    </div>
  )
}

Props

PropTypeDefaultDescription
srcstringβ€”Image source URL.
altstringβ€”Alt text for the image.
fallbackstring"?"Fallback text when image fails or is missing.
size"xs" | "sm" | "md" | "lg" | "xl""md"The size of the avatar.
status"online" | "offline" | "away" | "busy"β€”Status indicator badge.
ringbooleanfalseAnimated conic-gradient ring around avatar.
classNamestringβ€”Additional CSS classes to apply.