Avatar
A circular image-or-initials display with status indicators, plus a stacked group with overflow handling.
Basic Usage
Default Avatar
Image, initials, and icon fallbacks with optional status dot.
import { Avatar } from 'fluxo-ui';
<Avatar src="https://i.pravatar.cc/120?u=jane" alt="Jane Doe" />
<Avatar name="Jane Doe" />
<Avatar name="Marcus" status="online" />
<Avatar name="Anna" status="busy" shape="rounded" />Sizes & Shapes
Sizes
Five preset sizes plus arbitrary pixel values.
<Avatar name="A" size="xs" />
<Avatar name="A" size="sm" />
<Avatar name="A" size="md" />
<Avatar name="A" size="lg" />
<Avatar name="A" size="xl" />
<Avatar name="A" size={120} />Statuses
Statuses & Positions
All four statuses across all four positions.
<Avatar name="A" status="online" />
<Avatar name="B" status="busy" statusPosition="top-right" />
<Avatar name="C" status="away" statusPosition="bottom-left" />
<Avatar name="D" status="offline" statusPosition="top-left" />Avatar Group
Avatar Group
Stack avatars with overflow and an optional popover listing the hidden ones (click +N). Hover any avatar to bring it to the front, click to fire the per-avatar callback.
const [selected, setSelected] = useState(null);
<AvatarGroup
max={4}
onAvatarClick={(item, index) => setSelected({ ...item, index })}
>
<Avatar name="Jane Doe" status="online" />
<Avatar name="Marcus Lopez" status="busy" />
<Avatar name="Anna Kim" status="away" />
<Avatar name="Olivia Park" status="offline" />
<Avatar name="Diego Reyes" />
<Avatar name="Hugo Liu" />
</AvatarGroup>Clickable
Clickable Avatar
When onClick is provided the avatar renders as a focusable button.
<Avatar name="Jane" onClick={() => setSelected('Jane')} />Import
import { Avatar, AvatarGroup } from 'fluxo-ui';
import type { AvatarProps, AvatarGroupProps, AvatarSize, AvatarShape, AvatarStatus } from 'fluxo-ui';Avatar Props
srcstringImage URL
srcstringImage URL
namestringUsed to derive initials and a deterministic background color when no src is provided or when the image fails
namestringUsed to derive initials and a deterministic background color when no src is provided or when the image fails
iconIconComponent | ReactElementFallback when neither src nor name is available
iconIconComponent | ReactElementFallback when neither src nor name is available
altstringAccessible image alt text (defaults to name)
altstringAccessible image alt text (defaults to name)
shape'circle' | 'rounded' | 'square'"'circle'"Avatar shape
shape'circle' | 'rounded' | 'square'"'circle'"Avatar shape
size'xs' | 'sm' | 'md' | 'lg' | 'xl' | number"'md'"Preset size or pixel value
size'xs' | 'sm' | 'md' | 'lg' | 'xl' | number"'md'"Preset size or pixel value
status'online' | 'offline' | 'busy' | 'away'Status indicator dot
status'online' | 'offline' | 'busy' | 'away'Status indicator dot
statusPosition'top-right' | 'top-left' | 'bottom-right' | 'bottom-left'"'bottom-right'"Status dot placement
statusPosition'top-right' | 'top-left' | 'bottom-right' | 'bottom-left'"'bottom-right'"Status dot placement
colorFromNameboolean"true"When no src, derive a stable background color from the name
colorFromNameboolean"true"When no src, derive a stable background color from the name
loading'lazy' | 'eager'"'lazy'"Image loading strategy
loading'lazy' | 'eager'"'lazy'"Image loading strategy
onClick(e: MouseEvent) => voidWhen provided, renders as a focusable button
onClick(e: MouseEvent) => voidWhen provided, renders as a focusable button
idstringHTML id attribute
idstringHTML id attribute
classNamestringAdditional CSS classes
classNamestringAdditional CSS classes
ariaLabelstringAccessible label override
ariaLabelstringAccessible label override
AvatarGroup Props
childrenReactNodeMultiple Avatar children
childrenReactNodeMultiple Avatar children
itemsArray<AvatarProps>Alternative array prop instead of children
itemsArray<AvatarProps>Alternative array prop instead of children
maxnumberCap visible avatars; the rest collapse into a +N chip
maxnumberCap visible avatars; the rest collapse into a +N chip
overlapnumber"8"Pixels of overlap between adjacent avatars
overlapnumber"8"Pixels of overlap between adjacent avatars
direction'ltr' | 'rtl'"'ltr'"Visual stack order
direction'ltr' | 'rtl'"'ltr'"Visual stack order
size'xs' | 'sm' | 'md' | 'lg' | 'xl' | number"'md'"Applied to all children
size'xs' | 'sm' | 'md' | 'lg' | 'xl' | number"'md'"Applied to all children
shape'circle' | 'rounded' | 'square'"'circle'"Applied to all children
shape'circle' | 'rounded' | 'square'"'circle'"Applied to all children
onAvatarClick(item: AvatarProps, index: number, e: MouseEvent) => voidFires when any avatar inside the group is clicked, including avatars revealed via the overflow popover. The index reflects the avatar's position in the original full list.
onAvatarClick(item: AvatarProps, index: number, e: MouseEvent) => voidFires when any avatar inside the group is clicked, including avatars revealed via the overflow popover. The index reflects the avatar's position in the original full list.
onOverflowClick() => voidCustom handler for the +N chip; when omitted, opens a popover with the hidden avatars
onOverflowClick() => voidCustom handler for the +N chip; when omitted, opens a popover with the hidden avatars
idstringHTML id attribute
idstringHTML id attribute
classNamestringAdditional CSS classes
classNamestringAdditional CSS classes
ariaLabelstringAccessible label for the group
ariaLabelstringAccessible label for the group
Features
Smart Fallbacks
Falls back from image → initials → icon when sources fail; deterministic color from the name.
4 Statuses
Online, busy, away, and offline with screen-reader-only labels.
Group with Overflow
Cap visible avatars; remaining ones collapse into a focusable +N popover.
Shape & Size
Circle / rounded / square shapes plus five preset sizes or arbitrary pixel values.