Skip to main content
Version: 1.0.3

Avatar

Overview

The avatar component displays user profile pictures, initials, or icons with support for various shapes, sizes, and status indicators.

Preview

User avatar

Installation

ignix add component avatar

Usage

Import the component:

import { Avatar, AvatarGroup } from '@mindfiredigital/ignix-ui';

Avatar with Status Indicator

Online user

Online

Away user

Away

Busy user

Busy

Offline user

Offline

Different Shapes

Square

Square

Circle

Circle

Rounded

Rounded

Hexagon

Hexagon

Pentagon

Pentagon

Octagon

Octagon

Rhombus

Rhombus

Different Sizes

Extra Small
Small
Medium
Large
Extra Large
2XL
3XL
4XL
5XL

Avatar with Initial Letters

JD
AS
BJ
ED

Avatar with Icon

Avatar Group

User 1
User 2
User 3
User 4
+4
User 1
User 2
User 3
User 4
User 1
User 2
+2
User 1
User 2
User 3
+5

Props

Avatar

PropTypeDefaultDescription
srcstring-Image source URL
altstring'Avatar'Alternative text for screen readers
fallbackReact.ReactNode-Custom fallback content when image fails to load
fallbackDelaynumber600Delay in ms before showing fallback
shape'circle' | 'square' | 'rounded' | 'decagon' | 'hexagon' | 'pentagon' | 'star' | 'diamond' | 'triangle' | 'triangle-down' | 'parallelogram' | 'rhombus' | 'cross' | 'octagon' | 'ellipse' | 'egg' | 'trapezoid''circle'Shape of the avatar
iconReact.ReactNode-Icon component to display
lettersstring-Text to display as initials (e.g., "John Doe")
status'online' | 'offline' | 'away' | 'busy'-Status indicator
borderedbooleanfalseAdd border around avatar
clickablebooleanfalseMake avatar clickable with hover effects
size'xs' | 'sm' | 'md' | 'lg' | 'xl' | '2xl' | '3xl' | '4xl' | '5xl' | '6xl' | '7xl' | '8xl' | '9xl''md'Size of the avatar
backgroundColorstring-Optional custom background color
onClickReact.MouseEventHandler<HTMLDivElement>-Click handler for the avatar
classNamestring-Additional CSS classes
refReact.Ref<HTMLDivElement>-Ref to the avatar element

AvatarGroup

PropTypeDefaultDescription
childrenReact.ReactNode-Avatar components to group
maxnumber-Maximum number of avatars to show before displaying "+X"
spacingnumber-4Spacing between avatars (negative for overlap)
size'xs' | 'sm' | 'md' | 'lg' | 'xl' | '2xl' | '3xl' | '4xl' | '5xl' | '6xl' | '7xl' | '8xl' | '9xl''md'Size for all avatars in the group (can be overridden by individual avatars)
classNamestring-Additional CSS classes
refReact.Ref<HTMLDivElement>-Ref to the avatar group element