Browse the docs

Avatar

Doodle faces generated from a name, so the same person always gets the same face. Real photos can drop in too.

Server ComponentWCAG AASince v0.1

Live example

Change every prop live in the playground.

Props

Avatar

PropTypeDefaultWhat it does
namerequiredstringnoneThe person's name. Picks their doodle face and becomes the accessible name.
classNamestringnoneExtra class on the avatar.
faceHrefstringnoneDraw the face from an AvatarSymbol with this href (e.g. "#face-rosa") instead of inline. For crowds of repeated faces.
loadingbooleanfalseStill on its way: a paper scrap the same size and shape, read out as "Loading". name may be empty.
size"sm" | "md" | "lg" | "xl"mdFace size: sm 36px, md 52px, lg 76px, xl 86px.
srcstringnoneA photo URL; replaces the doodle.
status"online" | "busy" | "offline"noneA status dot. Its meaning is added to the accessible name ("Jun Reyes, online").
statusLabelstringonline / busy / offlineWords for the status, e.g. "on a call".
tiltnumber0Rotation in degrees.

AvatarStack

PropTypeDefaultWhat it does
namesrequiredstring[]noneAvatars to show (decorative inside the stack; the stack carries the name).
childrenReactNodenoneNot rendered: the faces come from names.
classNamestringnoneExtra class on the stack.
labelstring"Rosa, Jun, Ana and 4 more"Accessible name.
maxnumber3How many faces to show before "+N".

Use it well

DoPass the person's real name, so the face and the accessible name match.
Don'tRely on the status dot alone. Its meaning is part of the name for a reason.

Accessibility

  • role="img" named after the person; the status joins the name ("Jun Reyes, online").
  • Stacks are named "Rosa, Jun, Ana and 4 more".
Five stamps!

All aboard.

You took the whole tour. Here's Holo Pip, a foil sticker for riders who finish. It's in your playground tray now, for good.