StartFoundationsComponentsContent

Avatar

An avatar shows who or what something belongs to: a photo, or initials on a colored background.

Stable Figma
OverviewUsageAPIAccessibility
<tk-avatar shape="circle" name="Mira Petrova"></tk-avatar>
<tk-avatar name="Acme Corp"></tk-avatar>

Anatomy

Part What it is
tk-avatar the frame, a circle or a rounded square
image the photo from src, with a thin inner border
initials white letters from name, on a colored background
badge slot an optional Badge on the corner

Shape

<tk-avatar shape="circle" name="Mira Petrova"></tk-avatar>
<tk-avatar name="Acme Corp"></tk-avatar>
<tk-avatar name="Release bot"></tk-avatar>
  • circle: live people only.
  • square (default): everything else: organizations, workspaces, teams, products, and bots, even a bot with a name and a face.

Use one shape per kind of thing across your product.

Sizes

<tk-avatar name="Mira Petrova" size="20"></tk-avatar>
<tk-avatar name="Mira Petrova" size="24"></tk-avatar>
<tk-avatar name="Mira Petrova"></tk-avatar>
<tk-avatar name="Mira Petrova" size="40"></tk-avatar>
<tk-avatar name="Mira Petrova" size="48"></tk-avatar>
<tk-avatar name="Mira Petrova" size="64"></tk-avatar>
size Square corner Initials Typical place
20 radius-4 one letter, 12px inline with text
24 radius-4 12px dense lists, table cells
32 (default) radius-8 14px list rows, comments
40 radius-8 16px cards, headers
48 radius-8 18px page headers
64 radius-12 24px profiles

Image and initials

<tk-avatar shape="circle" src="/photos/mira.jpg" name="Mira Petrova"></tk-avatar>

An avatar always shows something:

  1. The image, when src loads. If it fails, the avatar falls back on its own.
  2. Initials, when there's no image: the first letters of the first and last words of name ("Mira Petrova" shows MP).
  3. The background alone, when there's no image and no name.

Color

<tk-avatar name="Design team" color="purple"></tk-avatar>
<tk-avatar name="Support team" color="teal"></tk-avatar>

The background is one of twelve colors: blue, indigo, red, orange, yellow, green, mint, teal, cyan, purple, pink, brown. Without color, the name picks one, and the same name always gets the same color. The backgrounds look the same in every theme.

Badge

<tk-avatar shape="circle" name="Mira Petrova">
  <tk-badge slot="badge" dot tone="success" label="Online"></tk-badge>
</tk-avatar>
<tk-avatar size="48" name="Acme Corp">
  <tk-badge slot="badge" tone="error" treatment="solid" count="4" label="4 incidents"></tk-badge>
</tk-avatar>
  • A count badge goes on the top corner, for notifications. A dot or a label badge goes on the bottom corner, for presence. The avatar picks the corner.
  • Use one badge per avatar. A dot fits sizes 24 to 48; a count reads best from 40.
  • The badge has a 2px ring in the page color. On a surface other than surface/default, restyle the ring.
  • Inside an Avatar group, badges are hidden.