Avatar

Interactive documentation for the avatar component. Change props in the playground, inspect sizes, types, fallback initials, and chip state.

Preview

User photo

Code

<Avatar
  size="3xl"
  type="photo"
  src="/Photo.png"
  alt="User photo"
  chip
  initials="AB"
/>

Sizes

All available avatar sizes in photo, icon, and initials modes.

SizePhotoIconInitialsWith chip
xs
User photo
AB
User photo
s
User photo
AB
User photo
m
User photo
AB
User photo
l
User photo
AB
User photo
xl
User photo
AB
User photo
2xl
User photo
AB
User photo
3xl
User photo
AB
User photo
4xl
User photo
AB
User photo
5xl
User photo
AB
User photo
6xl
User photo
AB
User photo

Types

Photo type renders image when src exists. Icon type renders fallback content.

Photo

User photo
User photo
User photo

Icon

Initials

AB
CD
EF

States

Dedicated examples for chip, empty src, initials fallback, and image alt.

With chip

AB

Without chip

AB

Photo without src

AB
CD

Initials normalize

A
AB
AB

Props

This table matches the current AvatarProps interface.

PropTypeDefaultRequiredDescription
size'xs' | 's' | 'm' | 'l' | 'xl' | '2xl' | '3xl' | '4xl' | '5xl' | '6xl''xs'OptionalControls avatar size, icon size, initials text size, and chip size.
type'photo' | 'icon''icon'OptionalControls avatar rendering mode. Photo mode renders image when src is provided.
srcstringundefinedOptionalImage source used for photo avatar.
altstring''OptionalAlt text for the avatar image.
chipbooleanfalseOptionalWraps avatar with Chip component using size mapped from avatar size.
initialsstring''OptionalFallback initials. Shows up to two uppercase characters when src is not provided.