# Avatar

> A circular user image with a text fallback.

- Category: [Text & media](https://tarve.dev/docs.md#text-media)
- Import: `import { Avatar } from "@tarve/core";`
- Props type: `AvatarProps`
- Source: [packages/core/src/extra-controls.ts:65](https://github.com/omarcosr/tarve/blob/main/packages/core/src/extra-controls.ts#L65)

## Usage

```tsx title="Avatar.tsx"
import { Avatar, Row } from "@tarve/core";

<Row gap={8}>
  <Avatar src="assets/ada.png" fallback="AL" size={48} />
  <Avatar fallback="GH" size={48} />
</Row>
```

## Props

| Prop | Type | Default | Description |
| --- | --- | --- | --- |
| `fallback` | `string` | `"?"` |  |
| `fit` | `"cover" \| "contain"` | `"cover"` |  |
| `size` | `number` | `40` |  |
| `src` | `string` | — |  |

## Common props

Shared by every component (descriptions: https://tarve.dev/docs.md#common-props): `children`, `class`, `className`, `highlight`, `id`, `key`, `motionFrom`, `onHighlight`, `onPaste`, `onPointerLeave`, `onPointerMove`, `onSize`, `onTransitionEnd`, `rovingGroup`, `style`.

Previous: [Image](https://tarve.dev/docs/components/Image.md) · Next: [Icon](https://tarve.dev/docs/components/Icon.md)

---

Tarve v0.13.8 · HTML version: https://tarve.dev/docs/components/Avatar · Index for agents: https://tarve.dev/llms.txt
