Avatar

Represents a user with an image, initials fallback, and optional presence status. Multi-part over Radix Avatar; size and shape flow to every part through Context.

JE

Installation#

# One-time setup (tokens + lib helpers)npx koalaui-cli@latest init# Add this component (its dependencies come along)npx koalaui-cli@latest add avatar

Usage#

usage.tsxTSX
import { Avatar, AvatarImage, AvatarFallback } from "@/components/ui/avatar"export function Example() {  return (    <Avatar>      <AvatarImage src="/jordi.jpg" alt="Jordi Espinosa" />      <AvatarFallback>JE</AvatarFallback>    </Avatar>  )}

Sizes#

Five fixed sizes, from xs (24px) to xl (64px). The status dot and fallback text scale with the box.

J
xs24px
J
sm32px
JE
md40px
JE
lg48px
JE
xl64px

Shape#

Circular by default; set shape="square" for a rounded-square avatar (e.g. organizations).

JE
circlePeople
JE
squareOrganizations

Fallback#

When no image is provided or it fails to load, Radix shows the fallback. Use delayMs to avoid a flash while a valid image loads.

JEKO

The fallback adapts to the box. A small avatar (xs/sm) shows a single initial so the glyph never crowds the silhouette; md and up show two. Pass the same two-letter string everywhere and let the size decide, or override per instance with maxInitials.

J
xs24px
J
sm32px
JE
md40px
JE
lg48px
JE
xl64px

Color#

color tints the initials fallback with a soft background and strong text from a single categorical token - the same palette as the Badge hues, so it re-themes across all four themes. Use it to distribute initials across users, teams, or tags. It only paints the fallback; an image, when present, covers it.

KO
default
JE
brand
MJ
purple
AL
pink
RT
teal
SD
orange

Status#

AvatarStatus adds a presence dot that sits outside the silhouette and reuses the status tokens (online/away/busy/offline).

JE
onlineActive now
JE
awayIdle
JE
busyDo not disturb
JE
offlineLast seen earlier

The position prop controls which corner the dot occupies - useful when another element (icon, badge) already occupies the default bottom-right corner.

JE
bottom-rightdefault
JE
top-right
JE
bottom-left
JE
top-left

Logo badge#

AvatarBadge is the same corner overlay as AvatarStatus, but it holds a brand or app mark instead of a presence dot. Drop an <img> or icon inside and it fits the coin, which carries a ring-background gap so it reads off the photo behind it. Use it to tag who someone is on another platform, an org badge, or a verified mark.

SStripe
Stripe
FFigma
Figma
SSpotify
Spotify
DDropbox
Dropbox

The coin's shape is its own, independent of the avatar: keep the round coin or set shape="square" for the classic app-icon look.

JEDropbox
circledefault
JEDropbox
squareApp icon

It scales with the avatar and takes the same position prop as the status dot, so you can move it off the default bottom-right corner.

JSpotify
xs24px
JSpotify
sm32px
JESpotify
md40px
JESpotify
lg48px
JESpotify
xl64px

Stack#

AvatarGroup stacks collaborators into one cluster. It owns the overlap, the ring-background separation, and the hover lift, so the children stay plain Avatars with no per-instance ring or z-index. Cap the visible count with max and the rest collapse into a +N chip; pass total when the real count exceeds the avatars you render. Match the group's size to its children; the overlap tightens as the box grows.

sm
JMLS+5
md
JEMDLCSR+5
lg
JEMDLCSR+5

Reach for renderOverflow to swap the default chip for a richer affordance, like a Tooltip that names the people the stack hides. See the full API on the Avatar Group page.

Examples#

Common patterns where avatars appear in product UI - combined with other components.

JE

Jordi Espinosa

Product Designer

Admin

Team members

  • J
    Jordi Espinosa
    jordi@koala.ui
    Admin
  • M
    Marie Dubois
    marie@koala.ui
    Editor
  • L
    Liam Chen
    liam@koala.ui
    Viewer
  1. J
    Jordi Espinosa
    The new token system is really clean. Switching themes feels instant now.
  2. M
    Marie Dubois
    Agreed, and the shadow scale is exactly what the cards needed.
  3. L
    Liam Chen
    Shipping this to staging today. Will update once QA signs off.

FAQ#

The fallback reads the resolved `size` from context and caps initials to fit the box: `xs` and `sm` show one initial so the glyph never crowds the silhouette, while `md` and up show two. Pass the same two-letter string everywhere and let size decide, or override per instance with `maxInitials`.