Avatar
Pre-alphaThe registry and the CLI are not published yet.Roadmap

Avatar

Profile image with an initials fallback.

GH

Grace HopperActive now

Sizes · image and initials fallback

A

AL

AT

KJ

LT

Group

A

B

C

+4

7 people going

Installation

npx axiom add avatar
pnpm dlx axiom add avatar
yarn dlx axiom add avatar
bun x axiom add avatar

Also copies: tappable.

Colors come from avatar.default.default.{background,foreground,ring} and avatar.status.default.{online,away,busy,offline} in the component tokens. colorFromName picks step 500 of a palette hue.

Usage

import { Avatar } from "@/components/ui/avatar";

<Avatar source={{ uri: user.photoUrl }} fallback="JC" />;

Props

Avatar

PropTypeDefaultDescription
sourceImageSourcePropTypeThe image. While it loads, or if it fails, the fallback is shown.
fallbackstring | ReactNodeShown without an image: usually 1–2 initials, or an icon.
namestringFull name. Used to compute initials when fallback is missing, and as the accessibility label.
size'xs' | 'sm' | 'md' | 'lg' | 'xl' | number'md'sm, md and lg come from the avatar size tokens (32, 40, 56pt). xs is 24, xl is 88. A number sets it directly.
shape'circle' | 'square''circle'square uses the md radius, for companies, groups or apps.
status'online' | 'away' | 'busy' | 'offline'Dot on the bottom-right corner, ringed with the background color.
colorFromNamebooleanfalsePicks a stable palette hue from name for the fallback background, so each person keeps the same color.
onPress() => voidMakes the avatar pressable, for example to open a profile.
styleStyleProp<ViewStyle>Extra styles for the container.

Avatar.Group

PropTypeDefaultDescription
childrenReactNodeAvatar elements. They overlap and get a ring in the background color.
maxnumberNumber of avatars shown before a +N counter.
sizeAvatarSize'sm'Applied to every avatar in the group.

Use cases

Chat header

A small avatar with a status next to the title tells who you’re talking to and whether they’re around.

AT

Alan TuringOnline

A

Can a machine think?

Lunch first.

<Avatar
	size="sm"
	source={{ uri: contact.photo }}
	name={contact.name}
	status={contact.online ? "online" : undefined}
/>

Missing photo

Without an image, initials on a color derived from the name. The same person always gets the same color.

Team

DR

Dennis RitchieEngineering

BL

Barbara LiskovResearch

ED

Edsger DijkstraAlgorithms
<Avatar
	name={member.name}
	source={member.photo ? { uri: member.photo } : undefined}
	colorFromName
/>

Who’s involved

Avatar.Group with max shows participants without taking a whole row per person.

Design reviewThursday · 14:00

A

B

C

+5

8 attending
<Avatar.Group max={3}>
	{attendees.map((a) => (
		<Avatar key={a.id} source={{ uri: a.photo }} name={a.name} />
	))}
</Avatar.Group>