Demos

An avatar with an image, and one with initials.

Usage

Use an avatar to show who a report, message, or appointment belongs to. Always include a fallback: it shows while the image loads and stays if the image fails.

Import it from @workspace/ui/components/avatar.

Anatomy

  • Avatar — The circle. Sets the size.
  • AvatarImage — The photo. Hidden until it loads.
  • AvatarFallback — Initials or an icon, shown when there is no image.
  • AvatarBadge — A dot in the bottom corner, such as an online status.
  • AvatarGroup — Overlaps several avatars.
  • AvatarGroupCount — The "+4" circle at the end of a group.

Notes

  • Give AvatarImage an alt with the person's name.
  • Use two initials at most.
  • The badge hides its icon at the sm size, where only the dot fits.

Examples

Sizes

sm, default, and lg.

With badge

A coloured dot, or a badge with an icon.

Group

A care team with a count of the rest. The count matches the size of the avatars in the group.

Props

Unlisted props pass through to the underlying element.

Avatar

PropTypeDefaultDescription
size"sm", "default", or "lg"default24, 32, or 40 pixels.

AvatarImage

PropTypeDefaultDescription
srcstring—Image URL.
altstring—The person's name.