Rebar UI

1.0

imitation

Avatar

A person, as initials or a portrait.

AvatarPortraits, initials, three sizes
MC

Maya Chen

JW

Jonas Weber

PN

Priya Nair

LS

Leo Santos

Initials
MCJWPNLS
Sizes
MCMCMC
Group
MCJWPNLS
Overflow
MCJWPN+3
Presence
MC
Fallback
?

In context

Crew listPortrait, name, role and presence
MC
Maya ChenDesign
Online
JW
Jonas WeberEngineering
In a meeting
PN
Priya NairResearch
Away
LS
Leo SantosOperations
Online
All portraits96 built-in portraits; placeholder={n} picks one, placeholder picks by name
01234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495

Upload overlay

Avatar with upload overlayEdit band, spinner while uploading, camera badge; click the photo
MKEdit

Tap the photo to change it.

Overlay “Edit”
MKEdit
Uploading
MKEdit
Camera badge
MK
Sizes (56, 72)
MKMK
Upload failed
MK

Try a smaller photo

Your DetailsIn context: uploading, then updated

Your Details

Profile

MK

Username

maria_k

Your Details

Profile

MKEdit

Username

maria_k

Tap the photo to change it.

Props

PropTypeRequiredDefault
srcstring | undefinedNo—
thumbSrcstring | undefinedNo—
altstring | undefinedNo—
fallbackstringYes—
classNamestring | undefinedNo—
placeholdernumber | boolean | undefinedNo—
sizenumber | "sm" | "md" | "lg" | "xl" | undefinedNomd
overlayReactNodeNo—
badgeReactNodeNo—
loadingboolean | undefinedNo—
invalidboolean | undefinedNo—

Accessibility

The initials are real text in the DOM, read even when no image loads. Pass a meaningful alt with a real src; with only fallback or placeholder the image is decorative and alt stays empty.

data-rebar-* attributes

data-rebar-component="avatar", data-rebar-size; data-rebar-part="fallback" on the initials.

Migrating to Ant Design

Not codemod-covered: AntD's Avatar takes fallback content as children, not a fallback prop, and has no illustrated placeholder, so a placeholder avatar needs a real src or plain initials.

thumbSrc blur-up

Pass thumbSrc (a tiny image) to show it blurred straight away while src loads, then fade the real image in, the same blur-up as Image. The initials stay hidden behind the thumb unless the image fails.

<Avatar src={photo} thumbSrc={photoTiny} fallback="MK" />