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="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

none

Profile avatar

gradient

Profile avatar

white

Profile avatar

primary

<ProfileAvatar ring="none" />
<ProfileAvatar ring="gradient" />  // Pink to sky gradient
<ProfileAvatar ring="white" />     // White ring
<ProfileAvatar ring="primary" />   // Theme primary color

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 fails to load.

S
J
<ProfileAvatar 
  src="/missing-image.jpg" 
  fallback="SC"
/>

Props

PropTypeDefaultDescription
srcstring-Image source URL
altstring"Avatar"Alt text for accessibility
size"sm" | "md" | "lg" | "xl""md"Avatar size
ring"none" | "gradient" | "white" | "primary""none"Ring style around avatar
status"online" | "offline" | "away" | "busy"-Status indicator
fallbackstring-Initials to show if image fails
classNamestring-Additional CSS classes