# Avatar

> The everyday avatar on Base UI: the photo once loaded, else initials on a tint derived from the name, else a person icon. Six sizes, circle or rounded square, a status dot and count badge seated on the corner arc, and an active ring. AvatarGroup overlaps them left to right and collapses the rest into a +N chip whose tooltip lists the hidden names.

- Slug: `avatar`
- Category: [Avatars](https://www.assembli.design/category/avatars.md)
- Type: component
- Tags: avatar, avatar-group, initials, status, presence, badge, tooltip, base-ui
- npm dependencies: @base-ui/react, lucide-react
- shadcn/ui dependencies: none
- Live preview: https://www.assembli.design/preview/avatar
- Page: https://www.assembli.design/components/avatar

![Avatar preview](https://www.assembli.design/thumbnails/avatar-light.png)

## Props

Other props pass through to the root element.

| Prop | Type | Default | Description |
| --- | --- | --- | --- |
| `src` | `string` |  |  |
| `name` | `string` |  | The person's name: the accessible label, the source of the initials and the tint. |
| `size` | `AvatarSize` | `"md"` |  |
| `shape` | `"circle" \| "square"` | `"circle"` |  |
| `status` | `AvatarStatus` |  |  |
| `badge` | `number \| React.ReactNode` |  | A count (capped at 99+) or a short node in the top corner. 0 hides it. |
| `active` | `boolean` |  | Draws a ring with a gap, for the current speaker, the active account or a live story. |

## Install

One-time setup (needs a subscription):

1. Add the registry to the project's `components.json`: `{"@assembli":{"url":"https://www.assembli.design/r/{name}.json","headers":{"Authorization":"Bearer ${ASSEMBLI_API_KEY}"}}}` (merge into `"registries"`).
2. Put an API key from https://www.assembli.design/account in `.env.local` as `ASSEMBLI_API_KEY=asm_…`.

Then install with the shadcn CLI (writes `components/avatar/avatar.tsx` and installs dependencies):

```bash
npx shadcn@latest add @assembli/avatar
```

Registry item JSON: https://www.assembli.design/r/avatar.json (send `Authorization: Bearer <api key>`)

## Code

> Component source needs an Assembli subscription ($12/month or $96/year) and an API key sent as `Authorization: Bearer <key>`. To get one without copying anything, POST https://www.assembli.design/api/agent/login (or call the MCP tool connect_account), show the user the link it returns, and poll https://www.assembli.design/api/agent/token for the key. Or subscribe at https://www.assembli.design/pricing and create a key at https://www.assembli.design/account.
