Avatar

Display user profile images, initials or fallback icons.

Sizes

size is in pixels. The default is 40.

MC
MC
MC
MC
MC

Types

The avatar shows the image from src. Without one, or when it fails to load, it shows up to two initials from fallbackText on a gradient. showInitials={false} keeps only the gradient, and fallback replaces it with your own node.

Jane Cooper
JL

User avatar

UserAvatar is the avatar for a person: round, 20 px by default, with a user icon when there is no image. alt is both the accessible label and the fallback text.

Jane Cooper
Jordan Lee
Jane Cooper
Jordan Lee

Avatar Properties

className
string

Additional CSS classes to apply to the avatar container

src
string{ src: string }

URL or static-import object of the image to display

fallbackTextRequired
string

Accessible label for the avatar, and the source of the initials shown when there is no image or it fails to load

showInitials
boolean

Show letter initials in the fallback

Default: true

fallback
ReactNode

Custom node rendered when the image is missing or fails

imageAlt
string

Alt text for the avatar image

Default: Avatar

imageRole
'presentation''none'

ARIA role applied to the avatar image

size
number

Size of the avatar in pixels

Default: 40

isLoading
boolean

Show loading skeleton state

Default: false

textSize
'small''large'

Size of the fallback text

Default: large

imagePriority
boolean

Load the image eagerly with high fetch priority

Default: false

UserAvatar Properties

altRequired
string

Accessible label and fallback text

src
string{ src: string }

URL or static-import object of the profile image

size
number

Size of the avatar in pixels

Default: 20

className
string

Additional CSS classes to apply to the avatar