Avatar

Display user profile images with automatic fallback to initials when no image is available. Supports status indicators, size variants, and animated transitions.

Import

import { Avatar, AvatarGroup } from '@wavebooking/aqua-fusion';

Preview

Loading preview...

Usage

<Avatar src="/user.jpg" alt="Jane Doe" name="Jane Doe" size="md" />

With status indicator

<Avatar
  src="/user.jpg"
  name="Jane Doe"
  status="online"
  showStatusIndicator
/>

Fallback initials

When src is not provided or the image fails to load, the component displays initials derived from the name prop.

<Avatar name="Jane Doe" size="lg" variant="primary" />

Avatar group

Stack multiple avatars with automatic overlap and a "+N" overflow indicator.

<AvatarGroup max={3} size="md">
  <Avatar name="Alice" src="/alice.jpg" />
  <Avatar name="Bob" src="/bob.jpg" />
  <Avatar name="Charlie" src="/charlie.jpg" />
  <Avatar name="Diana" src="/diana.jpg" />
</AvatarGroup>

Props

Avatar

PropTypeDefaultDescription
srcstring | null-Image URL for the avatar. Falls back to initials when absent or on error.
altstring-Alt text for the image. Defaults to name or "Avatar".
namestring-User name used to generate fallback initials.
size'xs' | 'sm' | 'md' | 'lg' | 'xl' | '2xl''md'Size of the avatar.
variant'default' | 'primary' | 'secondary''default'Color variant for the fallback background.
status'online' | 'offline' | 'busy' | 'away'-Presence status for the indicator dot.
showStatusIndicatorbooleanfalseWhether to display the status indicator dot.
borderedbooleanfalseAdd a white ring and shadow around the avatar.
animatebooleantrueEnable scale and hover animations via Framer Motion.
classNamestring-Additional CSS classes.

AvatarGroup

PropTypeDefaultDescription
children*React.ReactNode-Avatar components to display in the group.
maxnumber4Maximum number of avatars to show before displaying the "+N" overflow.
size'xs' | 'sm' | 'md' | 'lg' | 'xl' | '2xl''md'Size applied to the overlap spacing.
classNamestring-Additional CSS classes for the group container.