# components/Avatar (zidane-ui)

Import: `import { … } from 'zidane-ui'`. Source: [ui/src/components/Avatar.tsx](https://github.com/Tahul/zidane/blob/main/ui/src/components/Avatar.tsx).

## Components

### `Avatar`

Component.

Renders one person's face.

```ts
function Avatar(props: AvatarProps): Element
```

**Parameters**

- `props` (`AvatarProps`): The [`AvatarProps`](https://zidane.si/docs/reference/ui-components-avatar.md#AvatarProps).

**Returns** `Element`

**Props**

- `avatar?` (`string`): The photo's URL.
- `className?` (`string`): Extra classes on the root.
- `name` (`string`): The person's name: its first letter shows without a photo.
- `online?` (`boolean`): `true`: the online dot.
- `ring?` (`boolean`): A ring in the surface's color around the face (a stack).
- `size?` (`AvatarSize`, default `'sm'`): The face's size.
- `style?` (`CSSProperties`): Inline styles on the root.
- `typing?` (`boolean`): `true`: they type now, the breathing ring. `false`: the ring's place, faded out. Absent: none.

Source: [ui/src/components/Avatar.tsx:60](https://github.com/Tahul/zidane/blob/main/ui/src/components/Avatar.tsx#L60)

## Interfaces

### `AvatarProps`

Interface.

Props for [`Avatar`](https://zidane.si/docs/reference/ui-components-avatar.md#Avatar).

```ts
interface AvatarProps
```

**Properties**

- `avatar?` (`string`): The photo's URL.
- `className?` (`string`): Extra classes on the root.
- `name` (`string`): The person's name: its first letter shows without a photo.
- `online?` (`boolean`): `true`: the online dot.
- `ring?` (`boolean`): A ring in the surface's color around the face (a stack).
- `size?` (`AvatarSize`, default `'sm'`): The face's size.
- `style?` (`CSSProperties`): Inline styles on the root.
- `typing?` (`boolean`): `true`: they type now, the breathing ring. `false`: the ring's place, faded out. Absent: none.

Source: [ui/src/components/Avatar.tsx:17](https://github.com/Tahul/zidane/blob/main/ui/src/components/Avatar.tsx#L17)

## Types

### `AvatarSize`

Type.

The face sizes: `sm` 20px (a header's stack), `md` 28px (a card's row).

```ts
type AvatarSize = 'sm' | 'md'
```

Source: [ui/src/components/Avatar.tsx:14](https://github.com/Tahul/zidane/blob/main/ui/src/components/Avatar.tsx#L14)
