Skip to main content
Version: 1.0.3

Avatar

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

Interactive Avatar

Demo avatar

Current settings:

  • Size: md
  • Shape: circle
  • Type: image
  • Status: None
  • Bordered: No
  • Clickable: No
  • Upload: Disabled

All Sizes

Extra Small avatar
Extra Small
Small avatar
Small
Medium avatar
Medium
Large avatar
Large
Extra Large avatar
Extra Large

All Shapes

Circle avatar
Circle
Square avatar
Square
Rounded avatar
Rounded
Hexagon avatar
Hexagon
Pentagon avatar
Pentagon
Star avatar
Star
Diamond avatar
Diamond

All Types

Image
Image avatar
Letter
JD
Icon
Fallback
Broken image

Status Indicators

Online status
Online
Offline status
Offline
Away status
Away
Busy status
Busy

Installation

ignix add component avatar

Usage

Import the component:

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

Basic Usage

The Avatar component can be used to display user profile images with fallbacks.

User avatar

Examples

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