Profile Avatar

A rounded avatar component with gradient rings, status indicators, and fallback support.

Preview

User

Usage

import { ProfileAvatar } from "@/components/profile"

<ProfileAvatar
  src="/avatar.jpg"
  alt="User name"
  size="lg"
  ring
  ringColor="gradient"
  status="online"
/>

Sizes

Profile avatar

sm

Profile avatar

md

Profile avatar

lg

Profile avatar

xl

<ProfileAvatar size="sm" /> // 32px
<ProfileAvatar size="md" /> // 48px
<ProfileAvatar size="lg" /> // 64px
<ProfileAvatar size="xl" /> // 96px

Ring Styles

Profile avatar

ring=false

Profile avatar

ring=true

Profile avatar

gradient

Profile avatar

primary

Profile avatar

pink

Profile avatar

sky

Profile avatar

mint

<ProfileAvatar ring={false} />
<ProfileAvatar ring ringColor="gradient" />
<ProfileAvatar ring ringColor="primary" />
<ProfileAvatar ring ringColor="pink" />

Status Indicators

Profile avatar

online

Profile avatar

offline

Profile avatar

away

Profile avatar

busy

<ProfileAvatar status="online" />  // Green dot
<ProfileAvatar status="offline" /> // Gray dot
<ProfileAvatar status="away" />    // Yellow dot
<ProfileAvatar status="busy" />    // Red dot

Fallback

Show initials when the image is missing or fails to load.

Profile avatar

1 initial

Profile avatar

2 initials

<ProfileAvatar 
  src="/missing-image.jpg" 
  fallback="S"   // 1 initial
/>

<ProfileAvatar 
  src="/missing-image.jpg" 
  fallback="JD"  // 2 initials
/>

Props

PropTypeDefaultDescription
srcstring-Image source URL
altstring"Avatar"Alt text for accessibility
fallbackstring-Initials shown when image fails to load
size"sm" | "md" | "lg" | "xl""md"Avatar size
ringbooleantrueEnable ring around avatar
ringColor"primary" | "pink" | "sky" | "mint" | "gradient""gradient"Ring color style
status"online" | "offline" | "away" | "busy"-Status indicator
classNamestring-Additional CSS classes