Avatar
A versatile Avatar component for displaying user profile images, initials, or icons with a hand-drawn aesthetic and status indicators.
Avatar
The Avatar component in Faiz UI provides a hand-drawn sketch aesthetic for displaying user profile images, initials, or icons. It includes comprehensive status indicator functionality, multiple size options, and various customization features while maintaining the unique visual flair of the design system.
Installation
Usage
Sizes
Avatars are available in different sizes to fit various UI contexts, from compact lists to prominent profile displays.
Colors
Avatars come in various color options to match your design system and convey different meanings.
With Images
Avatars can display profile images with automatic fallback to initials when the image fails to load.

Status Indicators
Display user status with colored dots that are properly positioned and fully visible across all avatar variants.
Status with Different Sizes
Status indicators automatically scale and position correctly for all avatar sizes.
Status with Images
Status indicators work seamlessly with profile images, maintaining visibility and proper positioning.
Status with Different Variants
Status indicators maintain visibility across all avatar variants including different colors and border styles.
Custom Icons
Replace the default user icon or initials with custom icons for specialized use cases.
Clickable Avatars
Make avatars interactive with click handling and proper accessibility support.
Fallback Handling
Demonstrate how avatars handle various fallback scenarios gracefully.


Custom Styles
Apply custom styles using Tailwind CSS classes to create unique avatar appearances.
Dark Mode Support
Avatars automatically adapt to dark mode environments with appropriate styling adjustments.
Avatar Group
Create avatar groups for displaying multiple users in a compact layout.
Implementation Notes
- The Avatar component includes automatic initials generation from user names.
- Status indicators are positioned outside the content area to prevent clipping.
- All status dots include proper contrast borders and shadows for visibility.
- Images automatically fallback to initials when loading fails.
- The hand-drawn aesthetic is consistently applied across all variants and states.
- All avatars are fully accessible with keyboard navigation and screen reader support.
- Status indicators scale appropriately for each avatar size.
Props
Prop | Type | Default | Description |
---|---|---|---|
name | string | undefined | The name of the user. Used to generate initials when image is not available |
src | string | undefined | The source URL of the avatar image |
alt | string | undefined | The alt text for the avatar image |
initials | string | undefined | Custom initials to display instead of generated ones |
color | 'primary' | 'secondary' | 'success' | 'warning' | 'danger' | 'info' | 'primary' | The color theme of the avatar |
size | 'xs' | 'sm' | 'md' | 'lg' | 'xl' | 'md' | The size of the avatar |
radius | 'none' | 'sm' | 'md' | 'lg' | 'xl' | 'full' | 'full' | The border radius of the avatar |
showStatus | boolean | false | Whether to show a status indicator |
status | 'online' | 'offline' | 'away' | 'busy' | 'online' | The status of the user |
icon | React.ReactNode | undefined | Custom icon to display instead of image or initials |
fallback | React.ReactNode | undefined | Fallback component to render when image fails to load |
isBordered | boolean | true | Whether to show the border |
isDisabled | boolean | false | Whether the avatar is disabled |
isClickable | boolean | false | Whether the avatar is clickable |
onError | () => void | undefined | Callback fired when the image fails to load |
onClick | (event: MouseEvent) => void | undefined | Callback fired when the avatar is clicked |
customStyles | string | undefined | Custom CSS classes to apply |