Malevich

Primitives/

Avatar

Profile image with initials fallback.

Avatar

A user or entity representation showing initials, an image, or an icon. Avatars are visual atoms — they identify, they don't act.

When to use

Use an avatar wherever you need to put a face (or stand-in) next to a name: comment threads, member lists, ownership chips, presence indicators. When the avatar should navigate to a profile, the AUTHOR wraps it in <a>. The avatar component itself stays semantic-neutral.

Variants

Variant Class Use for
Default .avatar Neutral fallback (raised surface)
Accent .avatar.-accent Self, current user, highlight
Bone .avatar.-bone Warm fallback, secondary identity
Neutral .avatar.-neutral Disabled, archived, system

Sizes

Size Class Use for
Small .avatar.-s Inline lists, table rows
Medium (default) Most cases
Large .avatar.-l Profile headers, comment authors
XL .avatar.-xl Hero / detail page header

Pixel sizes follow size-control.s/m/l/xl from the semantic tier so avatars align with buttons, inputs, and other controls on the same row.

Anatomy

Initials:

<span class="avatar -accent">KM</span>
<span class="avatar -bone -l">DR</span>

Image:

<span class="avatar -l">
  <img src="/avatar.jpg" alt="Kazimir Malevich" />
</span>

Icon (placeholder for Phase 4 morph-icons):

<span class="avatar -accent">
  <svg aria-hidden="true" viewBox="0 0 24 24">…</svg>
</span>

The CSS handles all three content types: initials center via flexbox, <img> fills the circle with object-fit: cover, and <svg> shrinks to 60% of the avatar so it reads as an icon rather than a background.

Tokens used

Tier 3 (component-specific): none.

Accessibility

Edge cases

Do

Don't

Related