# AvatarGroup

> Who is involved, without a list. Medium Avatars overlapping by 8px, each ringed in the page colour, and how many more.

| | |
|---|---|
| Kind | component |
| Contract | `review` · [avatar-group.contract.yaml](https://github.com/Runceanu/rost/blob/master/contracts/avatar-group.contract.yaml) |
| Guidance | `proposed` |
| Source | [Figma 744:48](https://www.figma.com/design/1Zy0wiWKXQAvsfDBX3KR0d/UI-Kit-v01?node-id=744-48) · read 2026-11-16 · frozen 2026-11-16 |
| Implemented in | nowhere yet |

## Install

It lands in `src/rost/avatar-group/`, with what it needs and its contract:

```sh
npx github:Runceanu/rost add avatar-group
```

Then import `src/rost/fonts.css` and `src/rost/tokens.css` once, at the root of the app. More on this in [Install](https://rost.build/docs/install.md).

## Props

| Prop | Type | Values | Default |
|---|---|---|---|
| `people` | slot |  |  |
| `max` | number |  | `3` |

## Anatomy

- `root`: A row. It starts 8px in, so the first Avatar sits flush after each one pulls 8px back.
- `avatar`: A medium Avatar, pulled 8px over the one before, with a 2px ring in the page colour to keep them apart.
- `more`: How many more, in a 40px circle like a medium Avatar's.

## When to use

- **Who's on it.** The people on a project or the clients in a group, where the count matters more than the names.

## When not to use

- **A list of people.** When the names matter, write them out, with a small Avatar beside each.

## Behaviour

Up to `max` Avatars, overlapping, then +N for the rest.

## Accessibility

- **Element**: A `<div role="group">` labelled with all the names, so the hidden ones are read too.
- **Name**: Every name, in the group's label.
- **Colour**: The +N is 9:1 on its grey.

## Tokens

Every token this component uses, across all its variants.

| Token | Resolves to |
|---|---|
| `avatar/background` | `#3a3a3a` |
| `avatar/initials` | `#ededed` |
| `font-family/base` | `'General Sans Variable'` |
| `spacing/gap/small` | `8px` |
| `spacing/radius/full` | `10000px` |
| `spacing/size/medium` | `40px` |
| `typography/paragraph/font-size` | `14px` |
| `typography/paragraph/font-weight/medium` | `500` |
| `typography/paragraph/letter-spacing` | `0px` |
| `typography/paragraph/line-height` | `20px` |

## No token, on purpose

| Part | Property | Value | Why |
|---|---|---|---|
| `avatar` | `margin-left` | `calc(-1 * var(--spacing-gap-small))` | Composed from a token: the overlap. |
| `avatar` | `box-shadow` | `0 0 0 var(--spacing-outline-medium) var(--avatar-group-ring)` | Composed from tokens: a 2px ring in avatar-group/ring. |
| `more` | `margin-left` | `calc(-1 * var(--spacing-gap-small))` | Composed from a token: the overlap. |
| `more` | `box-shadow` | `0 0 0 var(--spacing-outline-medium) var(--avatar-group-ring)` | Composed from tokens: a 2px ring in avatar-group/ring. |

See it live, with every value of every variant: [rost.build/components/avatar/#avatar-group](https://rost.build/components/avatar/#avatar-group)
