Avatar
Circular image with an automatic fallback — initials, a custom icon, or a generic placeholder — plus a stacked, overlapping Avatar.Group.
Avatar wraps Ark UI's Avatar machine, which already tracks image-load state (loading → loaded/error): pass src and it renders the image once it loads, and falls back automatically — to children, to initials derived from name, or to a generic person icon — when there's no image or it fails to load. color="name" / color="initials" can derive a stable accent per person automatically, with no color picked by hand.
import { Avatar } from '@42-central/ui-react/avatar';
<Avatar src={user.avatarUrl} name={user.fullName} color="pink" />
<Avatar name="Ada Lovelace" color="teal" />
<Avatar />Playground
Component
Dir
Presets
Props
Code
<Component
color="pink"
size="md"
name="Ada Lovelace"
src="https://i.pravatar.cc/150?img=12"
/>Full prop browser
Fallback content
Explicit children always wins, then name-derived content, then a placeholder icon. This resolves the same way regardless of whether src is missing entirely or present but failed to load. display ("initials" by default, or "name") controls which name-derived form is shown — "name" is a single leading letter, since the full name would overflow a small circle. Initials are whole characters (an emoji, a flag or an accented letter is never cut in half) and are upper-cased the IntlProvider locale's way (i → İ in Turkish).
Code
<Avatar src="https://i.pravatar.cc/150?img=12" name="Ada Lovelace" color="pink" />
<Avatar name="Ada Lovelace" color="pink" />
<Avatar name="Ada Lovelace" display="name" color="pink" />
<Avatar color="pink">AL</Avatar>
<Avatar />Icons
icons replaces the kit's icons. Avatar has one, fallback: the person drawn last, when there's no image, no children and no name. children and name win over it. Set it to null to leave an empty disc. Your icons are drawn as given: add className={iconStroke} (from @42/ui-react) for the kit's 1.5px line.
Code
<Avatar icons={{ fallback: <Ghost className={iconStroke} /> }} color="purple" />
<Avatar icons={{ fallback: <Bot className={iconStroke} /> }} color="teal" />
<Avatar icons={{ fallback: <UserRoundX className={iconStroke} /> }} color="red" />
<Avatar icons={{ fallback: null }} color="neutral" />Colors
No variant axis — Avatar is always the same soft-surface look (the same treatment Pill and Badge's light variant use), neutral gray by default. Pass color to tint the surface and text with any palette accent.
Code
<Avatar name="Ada Lovelace" />
<Avatar color="brand" name="Ada Lovelace" />
<Avatar color="green" name="Grace Hopper" />
<Avatar color="purple" name="Zendaya" />Auto-color from name or initials
Set color="initials" or color="name" to skip picking a color by hand — it's deterministically hashed instead, so the same input always resolves to the same accent.
"initials"hashes the derived initials: two different people who happen to share initials get the same color, useful for visual grouping."name"hashes the full name directly: the same two people almost always get different colors, useful for per-person distinction even when initials collide.
Code
{/* "Ada Lovelace" and "Alex Lambert" both have the initials "AL" */}
<Avatar color="initials" name="Ada Lovelace" />
<Avatar color="initials" name="Alex Lambert" />
{/* same two names, but color="name" tells them apart */}
<Avatar color="name" name="Ada Lovelace" />
<Avatar color="name" name="Alex Lambert" />palette restricts (or extends) which colors the hash can land on — it defaults to AVATAR_PALETTE, a curated 9-color set that excludes brand (the kit's own primary/CTA identity color) and neutral (too muted to read as a distinct accent).
import { Avatar, AVATAR_PALETTE } from '@42-central/ui-react/avatar';
<Avatar color="name" name="Ada Lovelace" palette={['blue', 'purple']} />
<Avatar color="name" name="Ada Lovelace" palette={[...AVATAR_PALETTE, 'brand']} />Sizes & radius
size is the kit's shared xs–xl scale, plus two larger steps, 2xl (88px) and 3xl (128px), for a person shown as the subject of a screen rather than in a list. radius defaults to full — unlike ThemeIcon, which defaults to md — because an avatar reads as circular by default.
Code
<Avatar size="xs" name="Ada Lovelace" />
<Avatar size="sm" name="Ada Lovelace" />
<Avatar size="md" name="Ada Lovelace" />
<Avatar size="lg" name="Ada Lovelace" />
<Avatar size="xl" name="Ada Lovelace" />
<Avatar size="2xl" name="Ada Lovelace" />
<Avatar size="3xl" name="Ada Lovelace" />Code
<Avatar radius="xs" color="pink" name="Ada Lovelace" />
<Avatar radius="md" color="pink" name="Ada Lovelace" />
<Avatar radius="xl" color="pink" name="Ada Lovelace" />
<Avatar radius="full" color="pink" name="Ada Lovelace" />Avatar.Group
Avatar.Group overlaps a row (or, with orientation="vertical", a column) of standalone Avatars, the classic stacked-avatars look — each one gets a transparent notch cut into it (via mask-image) exactly where its successor overlaps it, so the separation is true see-through space rather than a painted border, and it reads correctly over any page background. It's pure layout — it doesn't resize or restyle its children, so set size/color per Avatar. spacing (the shared size scale) controls how much they overlap.
Code
<Avatar.Group>
<Avatar src="https://i.pravatar.cc/150?img=12" name="Ada Lovelace" />
<Avatar name="Grace Hopper" color="teal" />
<Avatar name="Zendaya" color="purple" />
<Avatar color="neutral">+4</Avatar>
</Avatar.Group>There's no built-in overflow counter — compose one yourself as a trailing Avatar (as above), the same way Mantine's own docs demonstrate it.
Code
<Avatar.Group spacing="xs">...</Avatar.Group>
<Avatar.Group spacing="xl">...</Avatar.Group>The notch matches each avatar's own radius, not just the default circle — a rounded-square avatar gets a true rounded-rect cutout that follows its neighbor's actual silhouette, not a circular bite:
Code
<Avatar.Group>
<Avatar radius="md" src="https://i.pravatar.cc/150?img=12" name="Ada Lovelace" />
<Avatar radius="md" name="Grace Hopper" color="teal" />
<Avatar radius="md" name="Zendaya" color="purple" />
<Avatar radius="md" color="neutral">+4</Avatar>
</Avatar.Group>orientation="vertical" stacks them as a column instead, each one overlapping the one above it and the notch cut at the bottom edge. A column runs top-to-bottom in either text direction, so dir doesn't affect it:
Code
<Avatar.Group orientation="vertical">
<Avatar src="https://i.pravatar.cc/150?img=12" name="Ada Lovelace" />
<Avatar name="Grace Hopper" color="teal" />
<Avatar name="Zendaya" color="purple" />
<Avatar color="neutral">+4</Avatar>
</Avatar.Group>API
Avatar
Prop
Type
No asChild — children is already repurposed as fallback content, which conflicts with Ark's "single child to render as" requirement for polymorphism (the same reasoning Skeleton documents for its own opt-out).
Avatar.Group
Prop
Type
Avatar.Group renders role="group" and forwards remaining props (incl. asChild) to its root div.
Accessibility
An avatar stands for a person, so it is read as one: the <img> takes alt, and when there is no image (or it fails to load) the fallback becomes role="img" with the same alt as its aria-label. The initials are presentational inside it, so a screen reader says "Ada Lovelace, image", never "AL". alt defaults to name, so the common case needs nothing extra:
<Avatar name="Ada Lovelace" /> {/* "Ada Lovelace" */}
<Avatar src={url} name="Ada Lovelace" alt="Ada Lovelace, admin" />
<Avatar alt="" name="Ada Lovelace" /> {/* decorative: hidden */}Pass alt="" when the avatar sits next to the person's name already: the image gets an empty alt and the fallback is aria-hidden, so the name isn't read twice. Custom children with neither alt nor name (a +3 overflow chip) stay plain text.
Avatar.Group is a role="group": give it an aria-label ("Project members") to name the stack.
Changelog
- #446
Two larger sizes,
2xl(88px) and3xl(128px)
- #361
Swap any built-in icon through an
iconsmap —icons={{ asc, desc }}on DataTable,icons={{ show, hide }}on PasswordInput; a key you leave out keeps the kit's icon, and a part'schildrenstill win - #387
Initials split by grapheme and upper-case for the locale ("😀 smile" →
😀S, Turkishi→İ), and an initials or failed-image avatar is an image named afteralt/name
- #267
Avatar.Groupstacks vertically withorientation="vertical"
- #61
New Avatar and
AvatarGroup, with a color and initials derived fromname
Geodesic badges
Faceted solids that show where a learner stands on a module, project, exam, activity or skill. One shape per level, one colour per status.
Indicator
Small dot or numeric/text badge overlaid on a corner or edge midpoint of another element — an unread-count bubble, a status dot, a processing pulse.