Skip to content
GitHub (opens in a new tab)

Avatar

Face or initials for a person (circle) or an organisation (square). Not a status chip and not a button.

stableAtomcontracts/avatar.json

Preview

Avatar

A person (circle) or an organisation (square), xs 20 to xl 48. Presence is a mark plus a word. Badge is for status. Not a button.

Master

A photo avatar at md, round. Variants shows initials, sizes, shapes and presence.

Maya Chen

Usage

Always pass name. src is optional — a missing or broken image falls back to initials from name. Use kit Avatar only. Badge is not for people. Several people go in AvatarGroup. A Lucide User icon appears only if both the image and initials fail.

Do's

  • Which mark: Avatar is a person or an organisation. Circle for people, square for organisations.
  • user menus
  • table assignee
  • comment authors
  • profile headers
  • customer or workspace in a table row — shape square

Don'ts

  • status or category chips — use Badge
  • actions — use Button
  • brand logos from a file — use LogoStrip or ask first
<Avatar name="Maya Chen" src="/faces/maya-chen.jpg" size="md" />

When to use

  • Which mark: Avatar is a person or an organisation. Circle for people, square for organisations.
  • user menus
  • table assignee
  • comment authors
  • profile headers
  • customer or workspace in a table row — shape square

When not to use

  • status or category chips — use Badge
  • actions — use Button
  • brand logos from a file — use LogoStrip or ask first

What an agent reads

import { Avatar } from "agentic-ds-kit";
must
  • when image shows, img alt=name (plus the presence word when set)
  • when fallback, role=img and aria-label=name (plus the presence word when set)
  • Decorative User icon is aria-hidden
  • Presence mark is aria-hidden; its word is in the name and its shape differs per state, so colour is never the only signal
  • presence words come from KitLabelsProvider (online, away, offline); English by default
defaults
  • size md
  • shape circle
stops if
  • do not invent local Avatar
  • do not use raw hex
  • do not make Avatar clickable without a new contract
  • do not add a count or status Badge on Avatar; presence is the only corner mark
  • do not show presence by colour alone; keep the word in visible text nearby
  • do not use Badge for people
  • do not use a circle for an organisation or a square for a person
  • do not use tone to show status; it only tells people apart

From contracts/avatar.json: must is the a11y requirements, defaults the prop defaults, stops if the doNot rules where the agent asks instead of inventing a cousin.

Props

NameTypeRequiredDefaultNotes
namestringYes——
srcstringNo——
initialsstringNo—Up to two letters, used instead of the ones taken from name. At size xs only the first letter shows.
sizexs | sm | md | lg | xlNomdxs 20 (12/16 caption, dense table; one initial, since two overflow the circle), sm 24 (14/20 table row), md 32 (two-line list), lg 40 (card or page header), xl 48 (profile header). Breaking: sm, md and lg were 32, 40 and 48; use md, lg and xl for the old sizes.
shapecircle | squareNocirclecircle for people, square for organisations (customers, vendors, workspaces). Square corners: xs and sm radius.sm, md radius.md, lg and xl radius.lg.
presenceonline | away | offlineNo—A corner mark with its own shape (solid, half, hollow) and a surface.card ring. The word (KitLabels online, away, offline) joins the accessible name, e.g. Ana Ruiz, Online. Also say it in visible text nearby, e.g. Online · ana@acme.com.
toneenumNo—Fallback tint for initials; no effect while a photo shows. Left out, the tint is picked from the name (today's look). neutral bg-tray, info info-line, success success-line, warning caution-line, accent highlight-line, each with its matching -fg text. Use it to tell people apart in a list; it is not a status, so keep any status in words. neutral | info | success | warning | accent
  • Component
    →

    Badge

    Compact read-only status or category pill set by the system.

  • Component
    →

    Button

    Clickable action control with appearance × mode (plus an optional flat set) and a fixed set of sizes.

  • Block
    →

    Logo strip

    A trusted-by wall of customer logos drifting in alternating rows.