<!-- generated by scripts/gen-docs.mjs from docs/system/avatar.md. Edit the source and rerun. -->
# Avatar

## Description
Shows who someone is: their picture, or the same silhouette for everyone without one, named once by the root or hidden when the name sits beside it.

`import { Avatar, AvatarImage, AvatarFallback, AvatarSilhouette, AvatarBadge, AvatarGroup, AvatarGroupCount } from "@/components/cobalt/ui/avatar"`, source `registry/cobalt/ui/avatar.tsx`, status `ready-with-gaps`.
Foundation: `shadcn avatar (base-luma, base)`. Traps checked: `trap/illustration-announced`, `trap/empty-value`, `trap/color-only-status`, `trap/decor-pointer`, `trap/surface-double-edge`, `trap/surface-matches-parent`, `trap/numbers-shift`, `trap/list-dead-gap`, `trap/link-as-button`, `trap/touch-hover-flash`.

The three sizes measure 24, 32 and 40px, the badge 12px on the large avatar, and a group overlaps by 8px; in a 310px column at 390 a group of 11 avatars and a count fits and the twelfth leaves the column (`.design-system/evidence/avatar/grow-count-390.json`). `trap/illustration-announced` is answered by the root as one image and the silent parts (ARIA), `trap/empty-value` by the silhouette for a missing picture (Rules), `trap/color-only-status` by the word beside the badge (Anti-slop), `trap/decor-pointer` by `pointer-events: none` on the image outline and `select-none` on the badge (Foundation). `trap/surface-double-edge` n/a: the hairline inside a photo is an outline and the ring in a group is the page colour, so no surface draws two edges and nothing casts a shadow. `trap/surface-matches-parent` n/a: the fallback's `--muted` is one step off the page, and the outline is the photo's edge, not a panel's. `trap/numbers-shift` n/a: the group count renders once per list and never updates in place. `trap/list-dead-gap`, `trap/link-as-button` and `trap/touch-hover-flash` n/a: an avatar is not clickable and has no hover; a host that links it wraps the whole avatar in one anchor.

### Foundation
| Given by the foundation | Added by the team |
|---|---|
| Base UI `Avatar.Root`, `Avatar.Image` and `Avatar.Fallback`: the image status, so the fallback shows while the picture loads and stays when it fails; `render` for composition; the `group`, `badge` and `count` parts from the shadcn file | `name` on the root as `role="img"` with `aria-label`, its runs of spaces collapsed and its ends trimmed, or, when the root is rendered as a link (`render` with an element that has `href` or `to`), as the link's `aria-label` with no image role, so the link stays a link, and `decorative` as `aria-hidden`, so the whole avatar is one named thing or none; a blank `name`, as an import leaves it, hides the avatar rather than announcing an image with an empty name; `alt` removed from `AvatarImage` by its type and fixed to empty, so the picture never carries a second name; the `AvatarSilhouette` as the default fallback, never initials, with the shoulders cropped by the circle; `image-outline`, the 1px hairline inside a photo; `data-size` on the root, read by the fallback, badge and count so one prop sizes every part; the badge a rounded square (`--r-xs`), since a status mark in Cobalt is square and a circle is kept for the avatar itself; the group count `min-w` and `h` of the avatar's size rather than a fixed square, with `whitespace-nowrap` and `tabular-nums`, so a count such as "+1,279" grows sideways into a rounded bar instead of spilling out of a 32px circle |

## Examples
Members in rows, three sizes, the fallback, a status mark and a group.

Real uses, 0 call sites (`rg -n "<Avatar\b" app docs/system/examples --glob '!docs/system/examples/avatar/*'`): the showcase chrome shows no people yet, and the examples folder does not count.

Uses inside the registry, which other components build on: none.

### Example files
| File | Covers | Caption |
|---|---|---|
| `docs/system/examples/avatar/default.tsx` | default | Members of a shared list, each row a link to the person's profile, with the avatar beside the name and read once |
| `docs/system/examples/avatar/size-sm.tsx` | size=sm | 24px, beside a name in a line of text |
| Not applicable: default.tsx shows the default size, 32px, in each row | size=default | 32px |
| `docs/system/examples/avatar/size-lg.tsx` | size=lg | 40px, at the head of a profile or a card |
| Not applicable: every example but state-fallback.tsx shows a loaded picture | state:loaded | The picture inside the circle with the hairline outline |
| `docs/system/examples/avatar/state-fallback.tsx` | state:fallback | In a list where some people have no picture, each of them gets the same silhouette |
| `docs/system/examples/avatar/state-decorative.tsx` | state:decorative | Beside the same name, so a screen reader hears it once |
| `docs/system/examples/avatar/state-badged.tsx` | state:badged | A square accent mark for something new from this person, with the words beside it |
| `docs/system/examples/avatar/state-grouped.tsx` | state:grouped | Overlapped by 8px, ringed in the page colour, then a count |
| `docs/system/examples/avatar/in-card.tsx` | composition:Card | The list's owner at the head of a card |

The pictures in the examples are stock portraits, square crops of one Unsplash photo in `public/photos/` (credited in `public/photos/CREDITS.md`), served at `/photos/`.

Example: Members of a shared list, each row a link to the person's profile, with the avatar beside the name and read once (`docs/system/examples/avatar/default.tsx`)

```tsx
import { Avatar, AvatarFallback, AvatarImage } from "@/components/cobalt/ui/avatar";
import {
  Item,
  ItemActions,
  ItemContent,
  ItemDescription,
  ItemGroup,
  ItemMedia,
  ItemTitle,
} from "@/components/cobalt/ui/item";

const members = [
  { id: "maya", name: "Maya Jacobsen", email: "maya@example.com", role: "Owner", photo: "/photos/portrait-2.webp" },
  { id: "gwen", name: "Gwen Holloway", email: "gwen@example.com", role: "Editor", photo: "/photos/portrait-1.webp" },
  { id: "kira", name: "Kira Jensen", email: "kira@example.com", role: "Viewer", photo: null },
];

export default function Example() {
  return (
    <ItemGroup variant="card" render={<ul />} className="max-w-md">
      {members.map((member) => (
        <li key={member.id}>
          <Item render={<a href={`#profile-${member.id}`} />}>
            <ItemMedia>
              {/* The name is the row's title, so the avatar is not read a second time. */}
              <Avatar decorative>
                {member.photo && <AvatarImage src={member.photo} />}
                <AvatarFallback />
              </Avatar>
            </ItemMedia>
            <ItemContent>
              <ItemTitle>{member.name}</ItemTitle>
              <ItemDescription>{member.email}</ItemDescription>
            </ItemContent>
            <ItemActions>{member.role}</ItemActions>
          </Item>
        </li>
      ))}
    </ItemGroup>
  );
}
```

Example: The list's owner at the head of a card (`docs/system/examples/avatar/in-card.tsx`)

```tsx
import { Avatar, AvatarFallback, AvatarImage } from "@/components/cobalt/ui/avatar";
import { Card, CardContent, CardDescription, CardHeader, CardTitle } from "@/components/cobalt/ui/card";

const photo = "/photos/portrait-2.webp";

export default function Example() {
  return (
    <Card className="max-w-sm">
      <CardHeader>
        <CardTitle>Reading list</CardTitle>
        <CardDescription>Twelve items, three unread.</CardDescription>
      </CardHeader>
      <CardContent className="flex items-center gap-3 text-sm">
        <Avatar decorative>
          <AvatarImage src={photo} />
          <AvatarFallback />
        </Avatar>
        Kept by Maya Jacobsen
      </CardContent>
    </Card>
  );
}
```

## Variants

### size
- `default`: 32px, for a row, a comment or a list item. Used at 0 call sites.
- `sm`: 24px, inline beside a name in a line of text, with the fallback's text one step smaller. Used at 0 call sites.
- `lg`: 40px, at the head of a profile, a card or a dialog. Used at 0 call sites.

Example: 24px, beside a name in a line of text (`docs/system/examples/avatar/size-sm.tsx`)

```tsx
import { Avatar, AvatarFallback, AvatarImage } from "@/components/cobalt/ui/avatar";

const photo = "/photos/portrait-4.webp";

export default function Example() {
  return (
    <div className="flex items-center gap-2 text-sm">
      <Avatar size="sm" decorative>
        <AvatarImage src={photo} />
        <AvatarFallback />
      </Avatar>
      Assigned to Anya Lindqvist
    </div>
  );
}
```

Example: 40px, at the head of a profile or a card (`docs/system/examples/avatar/size-lg.tsx`)

```tsx
import { Avatar, AvatarFallback, AvatarImage } from "@/components/cobalt/ui/avatar";

const photo = "/photos/portrait-2.webp";

export default function Example() {
  return (
    <Avatar size="lg" name="Maya Jacobsen">
      <AvatarImage src={photo} />
      <AvatarFallback />
    </Avatar>
  );
}
```

## States
| State | Trigger | What the user can do | Shown by, besides color | Checked by |
|---|---|---|---|---|
| loaded | `AvatarImage` has loaded its `src` | read the name beside it | the picture inside the circle with a 1px outline | by hand |
| fallback | no `AvatarImage`, or its `src` is loading or failed | read the name beside it | the silhouette, the same figure for everyone | test |
| decorative | `decorative` | nothing; the name beside it is what is read | the same picture or silhouette, `aria-hidden` | test |
| badged | an `AvatarBadge` child | read the word beside it | a rounded square on the corner, 10 to 12px with a 4px corner, ringed 2px in the page colour | test |
| grouped | inside `AvatarGroup` | read the count | the 8px overlap and the 2px ring that separates the faces, the `+N` count at the end, a circle while it fits and a rounded bar of the same height past three characters | test |

Example: In a list where some people have no picture, each of them gets the same silhouette (`docs/system/examples/avatar/state-fallback.tsx`)

```tsx
import { Avatar, AvatarFallback, AvatarImage } from "@/components/cobalt/ui/avatar";
import { Item, ItemContent, ItemDescription, ItemGroup, ItemMedia, ItemTitle } from "@/components/cobalt/ui/item";

const members = [
  { id: "anya", name: "Anya Lindqvist", email: "anya@example.com", photo: "/photos/portrait-4.webp" },
  { id: "gwen", name: "Gwen Holloway", email: "gwen@example.com", photo: null },
  { id: "kira", name: "Kira Jensen", email: "kira@example.com", photo: null },
];

export default function Example() {
  return (
    <ItemGroup variant="card" render={<ul aria-label="Members" />} className="w-full max-w-sm">
      {members.map((m) => (
        <Item key={m.id} render={<li />}>
          <ItemMedia>
            {/* The name is written beside it, so the avatar is not read again. */}
            <Avatar decorative>
              {m.photo && <AvatarImage src={m.photo} />}
              <AvatarFallback />
            </Avatar>
          </ItemMedia>
          <ItemContent>
            <ItemTitle>{m.name}</ItemTitle>
            <ItemDescription>{m.email}</ItemDescription>
          </ItemContent>
        </Item>
      ))}
    </ItemGroup>
  );
}
```

Example: Beside the same name, so a screen reader hears it once (`docs/system/examples/avatar/state-decorative.tsx`)

```tsx
import { Avatar, AvatarFallback, AvatarImage } from "@/components/cobalt/ui/avatar";

const photo = "/photos/portrait-4.webp";

export default function Example() {
  return (
    <div className="flex items-center gap-3 text-sm">
      <Avatar decorative>
        <AvatarImage src={photo} />
        <AvatarFallback />
      </Avatar>
      <div className="flex min-w-0 flex-col">
        <span>Anya Lindqvist</span>
        <span className="text-muted-foreground">anya@example.com</span>
      </div>
    </div>
  );
}
```

Example: A square accent mark for something new from this person, with the words beside it (`docs/system/examples/avatar/state-badged.tsx`)

```tsx
import { Avatar, AvatarBadge, AvatarFallback, AvatarImage } from "@/components/cobalt/ui/avatar";

const photo = "/photos/portrait-2.webp";

// The mark is the accent, as every unread mark is, and the words say what is new.
export default function Example() {
  return (
    <div className="flex items-center gap-2 text-sm">
      <Avatar name="Maya Jacobsen">
        <AvatarImage src={photo} />
        <AvatarFallback />
        <AvatarBadge />
      </Avatar>
      New reply
    </div>
  );
}
```

Example: Overlapped by 8px, ringed in the page colour, then a count (`docs/system/examples/avatar/state-grouped.tsx`)

```tsx
import { Avatar, AvatarFallback, AvatarGroup, AvatarGroupCount, AvatarImage } from "@/components/cobalt/ui/avatar";

const photos: Record<string, string> = {
  "Gwen Holloway": "/photos/portrait-1.webp",
  "Maya Jacobsen": "/photos/portrait-2.webp",
  "Kira Jensen": "/photos/portrait-3.webp",
  "Anya Lindqvist": "/photos/portrait-4.webp",
};

export default function Example() {
  return (
    <AvatarGroup>
      {Object.entries(photos).map(([name, src]) => (
        <Avatar key={name} name={name}>
          <AvatarImage src={src} />
          <AvatarFallback />
        </Avatar>
      ))}
      <AvatarGroupCount>+6</AvatarGroupCount>
    </AvatarGroup>
  );
}
```

### State precedence
- Loaded and fallback: Not applicable: Base UI shows the fallback until the image loads and the image after, so one or the other is in the tree.
- Decorative and loaded or fallback: both show. `decorative` changes the announcement and leaves the picture alone.
- Badged and grouped: both show. The badge sits on its own avatar's corner above the next avatar in the row, at `z-10`.
- Decorative and badged: both show. The badge is a silent mark either way, so the word beside the avatar carries the status.

### Motion
Not applicable: no motion. The picture replaces the silhouette with no transition.

## Props

<!-- Props generated from registry/cobalt/ui/avatar.tsx with TypeScript by scripts/props-table.mjs -->
### Avatar

| Prop | Type | Default | Purpose |
|---|---|---|---|
| `decorative?` | `boolean` | `false` | For an avatar beside the same name in text, so it is not read twice. |
| `name?` | `string` |  | Who this is; the avatar's accessible name. |
| `size?` | `"default" \| "sm" \| "lg"` | `"default"` | `default` 32px; `sm` 24px; `lg` 40px. |

Also accepts every native `<span>` attribute; from Base UI: `render`.

### AvatarImage

No props of its own.

Also accepts every native `<img>` attribute; from Base UI: `keepMounted`, `onLoadingStatusChange`, `render`.

### AvatarFallback

No props of its own.

Also accepts every native `<span>` attribute; from Base UI: `delay`, `render`.

### AvatarSilhouette

No props of its own.

Also accepts every native `<svg>` attribute.

### AvatarGroup

No props of its own.

Also accepts every native `<div>` attribute.

### AvatarGroupCount

No props of its own.

Also accepts every native `<div>` attribute.

### AvatarBadge

No props of its own.

Also accepts every native `<span>` attribute.

`name` is the person's name and the avatar's accessible name, trimmed, with runs of spaces collapsed, and a blank one hides the avatar; `decorative` hides the whole avatar; one of the two is set on every avatar that is not inside a labelled control. `size` is `default`, `sm` or `lg`, and the parts read it from the root. `AvatarImage` takes `src` and every `img` attribute except `alt`, which is fixed to empty. `AvatarFallback` takes children for a host that must show something other than the silhouette, and `AvatarSilhouette` takes `svg` attributes. `AvatarGroup`, `AvatarGroupCount` and `AvatarBadge` take `div` and `span` attributes. `className` is merged last on every part and is for placement.

## Usage

### When to use
- A row, a comment or a list item belongs to a person, and a face finds them faster than a name.
- A set of people share a thing, and the row shows who, with a count for the rest.

### When not to use
- The mark names a thing, such as a workspace or a project. Use Tag instead, which takes its hue from the key.
- The avatar would be a button, such as a menu trigger. Use Button with `render` around the avatar instead, so the control has a role and a name.
- The picture is content, such as a photo in a card. Use Card with an `img` as its first child instead.

### Rules
- `rule/avatar-name-or-decorative`: When an avatar stands alone, give it `name`, and when the same name is text beside it, give it `decorative`, instead of leaving both off, because a bare root has no role and no name, so a screen reader reads nothing or reads a filename, and a named avatar beside its name is read twice. Evidence: principle wcag: 1.1.1 Non-text content, every image has a text alternative or is marked decorative; principle wcag: 4.1.2 Name, role, value, the root is the one element with the role. Check: test `avatar.test.tsx` renders the three forms and reads `role`, `aria-label` and `aria-hidden`; review of every avatar beside text.
  - Don't: `<Avatar><AvatarImage src={person.photo} /><AvatarFallback /></Avatar>`
  - Do: `<Avatar name={person.name}><AvatarImage src={person.photo} /><AvatarFallback /></Avatar>`
- `rule/avatar-always-a-fallback`: When an avatar has an `AvatarImage`, give it an `AvatarFallback` too, instead of the image alone, because the image renders nothing until it loads and nothing at all when it fails, so without a fallback the circle is empty for the whole wait. Evidence: principle heuristic: visibility of system status, the place is filled before the picture arrives; principle platform: Base UI `Avatar.Image` renders only in the loaded state. Check: review of every `AvatarImage` for a sibling `AvatarFallback`.
  - Don't: `<Avatar name="Gwen Holloway"><AvatarImage src={photo} /></Avatar>`
  - Do: `<Avatar name="Gwen Holloway"><AvatarImage src={photo} /><AvatarFallback /></Avatar>`
- `rule/avatar-link-wraps-the-root`: When an avatar leads to a profile, wrap the whole `Avatar` in one anchor or render the root through `render` with the host's link, instead of a handler on the root, because the root is a `span` and a span that acts has no role, no tab stop and no key handling. Evidence: principle platform: one interactive element per action, the link carries the role and the avatar's `name` becomes the link's name; principle wcag: 2.1.1 Keyboard. Check: lint trap/link-as-button (scripts/check-system.mjs); review.
  - Don't: `<Avatar name="Anya Lindqvist" onClick={openProfile}><AvatarFallback /></Avatar>`
  - Do: `<Avatar name="Anya Lindqvist" render={<a href="/people/ada" />}><AvatarFallback /></Avatar>`
- `rule/avatar-size-on-the-root`: When an avatar needs another size, set `size` on the root instead of `className="size-12"` on the root or a part, because the fallback text, the badge and the group count read `data-size` from the root, and a class sizes the circle alone. Evidence: principle heuristic: consistency and standards, one prop sizes every part; person D27. Check: lint rule/component-override (scripts/check-system.mjs).
  - Don't: `<Avatar name="Maya Jacobsen" className="size-10"><AvatarFallback /><AvatarBadge /></Avatar>`
  - Do: `<Avatar name="Maya Jacobsen" size="lg"><AvatarFallback /><AvatarBadge /></Avatar>`

### Content
- `rule/avatar-name-is-the-person`: When `name` is set, write the person's name as the product shows it, such as "Anya Lindqvist", with no prefix such as "Avatar of" or "Photo of", because the role already says image and a screen reader would read "image, Avatar of Anya Lindqvist". Evidence: principle wcag: 1.1.1 Non-text content, the alternative says what the image shows, not that it is an image; principle platform: `role="img"` announces the role itself. Check: lint copy/template on the avatar slot (scripts/copy-check.mjs); review.
  - Don't: `<Avatar name="Avatar of Anya Lindqvist"><AvatarFallback /></Avatar>`
  - Do: `<Avatar name="Anya Lindqvist"><AvatarFallback /></Avatar>`
- `rule/avatar-count-is-plus-digits`: When a group ends in a count, write a plus and the digits formatted for the reader's locale, such as "+4" or "+1,279" from `Intl.NumberFormat`, for the people not shown, instead of "and 4 more", the total or raw digits such as "+1279", because the count sits in a 32px circle that widens only as far as the figures need, and the plus says it is the rest, not the whole. Evidence: principle heuristic: match between system and the real world, "+4" after four faces reads as four more; measured 32px count circle beside 32px avatars, .design-system/evidence/avatar/grow-count-390.json. Check: lint copy/template on the avatar slot (scripts/copy-check.mjs); review.
  - Don't: `<AvatarGroupCount>and 4 more</AvatarGroupCount>`
  - Do: `<AvatarGroupCount>+4</AvatarGroupCount>`

### Anti-slop
- `rule/avatar-no-initials`: When a person has no picture, render `AvatarFallback` with no children, which draws the silhouette, instead of their initials, because a letter in a circle reads as a brand mark, and two people with the same initial look like one person. Evidence: principle heuristic: recognition rather than recall, the same figure for everyone says "no picture" and never pretends to be one; principle wcag: 1.1.1 Non-text content, the root's `name` already carries the person, so the letters add nothing a screen reader needs. Check: review of every `AvatarFallback` with children.
  - Don't: `<Avatar name="Anya Lindqvist"><AvatarFallback>AL</AvatarFallback></Avatar>`
  - Do: `<Avatar name="Anya Lindqvist"><AvatarFallback /></Avatar>`
- `rule/avatar-badge-with-a-word`: When an `AvatarBadge` marks something new or a status, put the words beside the avatar, such as "New reply", instead of a coloured dot alone or a dot in `bg-good` and `bg-bad`, because the mark is 12px of colour with no text and a screen reader does not reach it. Evidence: principle wcag: 1.4.1 Use of color, colour never the only means; person D13. Check: lint rule/palette-use (scripts/check-system.mjs); review.
  - Don't: `<Avatar name="Maya Jacobsen"><AvatarFallback /><AvatarBadge className="bg-good" /></Avatar>`
  - Do: `<Avatar name="Maya Jacobsen"><AvatarFallback /><AvatarBadge /></Avatar> New reply`
- `rule/avatar-no-silhouettes-in-lists`: When a list or a table has no pictures for its people, leave `Avatar` out of every row instead of an `AvatarFallback` silhouette on each, because a column of identical grey heads says nothing and takes the width the names need. Evidence: measured 32 identical silhouettes in 16 screener rows, docs/research/2026-10-16-audit.md; principle heuristic: aesthetic and minimalist design, a mark that is the same on every row carries no information. Check: review of every list that renders `AvatarFallback` per row.
  - Don't: `{people.map((p) => <li key={p.id}><Avatar decorative><AvatarFallback /></Avatar>{p.name}</li>)}`
  - Do: `{people.map((p) => <li key={p.id}>{p.name}</li>)}`
- `rule/avatar-no-alt-on-the-image`: When an avatar has a picture, name it with `name` on the root and leave `AvatarImage` without `alt`, instead of `alt` on the image, because the root is the one named thing and a second name on the image makes a screen reader read the person twice, which is why the type refuses `alt`. Evidence: principle wcag: 1.1.1 Non-text content, one text alternative per image; principle platform: an `img` with `alt=""` inside a `role="img"` parent is silent. Check: lint by the type of `AvatarImage`, which omits `alt`, so `pnpm typecheck` fails the violation.
  - Don't: `<Avatar><AvatarImage src={photo} alt="Gwen Holloway" /><AvatarFallback /></Avatar>`
  - Do: `<Avatar name="Gwen Holloway"><AvatarImage src={photo} /><AvatarFallback /></Avatar>`

### Limits
- `rule/avatar-group-max`: When a group holds more than 5 people, render 5 avatars and an `AvatarGroupCount` with the rest, such as "+6", instead of every face, because at 12 avatars the row leaves a 310px column at 390 and long before that the 8px overlap hides more of each face than it shows. Evidence: measured overflow of the column at 12 avatars and of the viewport at 14 in a 310px column at 390, .design-system/evidence/avatar/grow-count-390.json; principle heuristic: recognition rather than recall, a face is found only when most of it shows. Check: probe `.design-system/scripts/grow-display.mjs` on the showcase at 390; review of every `AvatarGroup` for a count past 5.
  - Don't: `<AvatarGroup>{members.map((m) => <Avatar key={m.id} name={m.name}><AvatarFallback /></Avatar>)}</AvatarGroup>`
  - Do: `<AvatarGroup>{members.slice(0, 5).map((m) => <Avatar key={m.id} name={m.name}><AvatarFallback /></Avatar>)}{members.length > 5 && <AvatarGroupCount>+{members.length - 5}</AvatarGroupCount>}</AvatarGroup>`

## Accessibility
Rests on Base UI `Avatar.Root`, a `span` given `role="img"` by `name`; rendered as a link, the root is the link and `name` names it.

### Keyboard
| Key | Where focus is | Effect | Focus after | Checked by |
|---|---|---|---|---|
| Tab | before an avatar | skips it; an avatar is not focusable unless the host renders it as a link, and then the link takes focus | the next control, or the link | by hand |

### ARIA
| Part | Role | Accessible name from | States and properties | Announced | Checked by |
|---|---|---|---|---|---|
| root, with `name` | img | `aria-label`, the person's name | none | the name and "image" when the reader reaches it | test |
| root as a link, with `name` | link | `aria-label`, the person's name | none | the name and "link", never an image inside a link | test |
| root, with `decorative` | none | none, `aria-hidden="true"` | none | nothing; the name beside it is read once | test |
| root, with neither | none, a `span` | none | none | nothing, which is why one of the two is set | test |
| root, with a blank `name` | none, `aria-hidden="true"` | none | none | nothing, never an image with an empty name | test |
| image | none, `alt=""` | none | none | nothing | test |
| fallback and silhouette | none, the svg `aria-hidden` | none | none | nothing | test |
| badge | none, a `span` | none | none | nothing; the word beside the avatar carries the status | test |
| group count | none, a `div` | its text | none | the "+N" as plain text | test |

## Tokens
| Part | State | Token |
|---|---|---|
| root | all | `--outline-image` |
| fallback | all | `--muted`, `--muted-foreground`, `--foreground` at 15 percent for the silhouette, 20 percent in dark |
| badge | all | `--primary`, `--primary-foreground`, `--r-xs`, `--background` for the ring |
| group | all | `--background` for the ring |
| group count | all | `--muted`, `--muted-foreground`, `--background` for the ring |

## Related
- Tag: a mark for a thing, coloured by its key.
- Badge: a count or a state beside a name.
- Card: holds a picture that is content, such as a cover.
- FileDrop: takes files by drop or by a button, and shows each one's upload as it goes.
- Flag: a country, by its flag beside its name.
- ImageField: a picture to upload, crop, replace or remove, such as an avatar or a cover.
- MemberList: the people who can see something shared, their roles and the invitations still open.
