Components / Media

Avatar nativelite

A round user picture that falls back to initials on a stable hue.

A2UI basic
Image (avatar)
Children
none
Loading the renderer…
Avatar rendered by the React renderer on Web
Web React
Avatar rendered by the SwiftUI renderer on iOS
iOS SwiftUI
Avatar rendered by the Compose renderer on Android
Android Compose
Avatar rendered by the gpui renderer on Desktop
Desktop gpui

View exponential-ui-avatar, painted by each native renderer.

size · sm
size · default
size · lg
PropTypeDefaultDescription
namerequiredbindstring–The person's name; initials come from it.
srcbindurl–The picture URL.
sizesm | default | lg"default"Diameter class.
seedstring–Hashes the fallback hue; defaults to the name.

No events, no slots. Children: none.

Role
img
Semantics
img (name)

Not focusable; no keys.

Recipe parts
Avatar/rootAvatar/imageAvatar/fallback
Keyed by
size:hover:pressed:focus:disabled:checked:open:selected:invalid:dragover

Themes · Write a theme

Avatar

Picture first: a circle filled edge to edge by the person's image.

More

Without one the initials sit on THEIR hue — one of eight token colours picked by fnv1a32(utf8(userId)) % 8 — as a 20% fill under the glyph at full strength, no stroke. The hash is byte-identical on all four clients, so one person is one colour everywhere; a subject with no id at all (a bot, an unresolved reporter) keeps the muted fallback.

Webok
UserAvatarpackages/ui/src/user-avatar.tsx

AvatarFallback (./avatar.tsx) paints the hue; UserAvatar is the composition every site renders.

Desktopok
user_avatar::avatar_elementapps/desktop/crates/ui/src/user_avatar.rs