Avatar

Display user profile images with fallback support and status indicators

Primitive

An avatar shows a user's profile image, falling back to initials or an icon when the image is missing or fails to load. Use it in comment threads, member lists, navbars, and anywhere you identify a person or account.

Preview

CN

Installation

Usage

Composition

Examples

Sizes

Use size to set the avatar's dimensions.

SMMDLGXL
SizeDescription
smA compact avatar.
mdThe default avatar.
lgA larger avatar.

Fallback

AvatarFallback renders when the image is missing or fails to load.

JDABTK

Avatar Group

Overlap avatars to show a group of users compactly.

CNVCLN+5

With Status Indicator

Overlay a dot on the avatar to show online or offline state.

CN
VC
LN

Lazy and Optimized Images

By default, AvatarImage preloads src in the background and shows the image once it has loaded. Add keepMounted to render the image element right away and let it load in place instead. This lets loading="lazy" defer offscreen avatars, and works with image optimizers like next/image, which request a different URL than the raw src. The fallback shows until the image loads, and stays if it fails.

CNVCLNMS

Accessibility

Give AvatarImage an alt describing who it represents (typically the person's name). Provide an AvatarFallback so the avatar still conveys identity when the image fails to load.

API Reference

The Avatar component is built on top of Base UI's Avatar. All Base UI props are supported. The documentation below only covers custom props specific to our implementation.

For the complete Base UI API, see the Base UI Avatar documentation.

Custom Props

Avatar