Usage
The Avatar component displays user profile images with automatic fallback to initials or icons when images fail to load.Props
The element or component this component should render as. Can be a string/component for the root, or an object with
root and img properties to customize both elements.The source URL of the avatar image.
Alternative text for the image. Also used to generate fallback initials.
Icon name to display as fallback instead of initials. Supports any Iconify icon.
Custom text to display as fallback. Overrides the initials generated from
alt.The size of the avatar.
Display a chip (notification badge) on the avatar. Pass
true for default styling or an object with ChipProps for customization.Additional CSS classes to apply.
Inline styles to apply.
UI customization object for styling avatar slots (root, image, icon, fallback).
Slots
Custom content to display inside the avatar. Overrides the default image/icon/text fallback behavior.
Examples
Basic Avatar
Sizes
Fallback to Initials
When an image fails to load or is not provided, the avatar displays initials from thealt prop:
Custom Fallback Text
Icon Fallback
With Chip (Status Badge)
Custom Chip
Custom Content
As Different Elements
Avatar Group Integration
When used inside anAvatarGroup, the avatar automatically inherits the group’s size:
Notes
- The avatar automatically generates initials from the
altprop by taking the first character of each word (up to 2 characters) - Image loading errors are handled gracefully with automatic fallback to initials or icons
- Size dimensions (in pixels): 3xs=16, 2xs=20, xs=24, sm=28, md=32, lg=36, xl=40, 2xl=44, 3xl=48