# MessageAvatar

> **Info:** This is documentation for **Stream Chat React Native SDK v5**, which is no longer actively maintained. For up-to-date documentation, see the [latest version (v10)](https://getstream.io/chat/docs/sdk/react-native/).

Component to render the avatar of the sender (user) of a message within the [`MessageList`](https://getstream.io/chat/docs/sdk/react-native/v5/ui-components/message-list/).

## Basic Usage

You can customize the `MessageAvatar` component and provide it back to the SDK via the [`MessageAvatar`](https://getstream.io/chat/docs/sdk/react-native/v5/core-components/channel/#messageavatar) prop on `Channel` if desired.

Reducing the size of user avatar can be easily accomplished.

```tsx
import {Channel, MessageAvatar} from 'stream-chat-react-native';

const SmallerMessageAvatar = () => <MessageAvatar size={30} />

<Channel MessageAvatar={SmallerMessageAvatar} />
```

## Props

This component uses default values for all the following props, from [`MessageContext`](https://getstream.io/chat/docs/sdk/react-native/v5/contexts/message-context/)

### `alignment`

Sets if the message should be aligned to right or left side of list.

| Type                  | Default |
| --------------------- | ------- |
| enum('right', 'left') | 'right' |

### `lastGroupMessage`

Whether or not this is the last message in a [group of messages](https://getstream.io/chat/docs/sdk/react-native/v5/contexts/message-context/#groupstyles).

| Type    |
| ------- |
| boolean |

### `message`

Message object.

| Type           |
| -------------- |
| `Message` type |

### `size`

Dimension for avatar image.

>
> **Tip:** You can also set the size for message avatar, using our [theming system](https://getstream.io/chat/docs/sdk/react-native/v5/customization/theming/).
>
> ```tsx
> const theme = {
>   avatar: {
>     BASE_AVATAR_SIZE: 30,
>   },
> };
> ```
>

| Type   | Default |
| ------ | ------- |
| Number | 32      |

## UI Component Props

### `ImageComponent`

Drop in replacement of all the underlying [`Image`](https://reactnative.dev/docs/next/image) components within SDK.
This is useful for the purpose of offline caching of images. Please check the [Offline Support Guide](https://getstream.io/chat/docs/sdk/react-native/v5/basics/offline-support/) for usage.

| Type          | Default                                            |
| ------------- | -------------------------------------------------- |
| ComponentType | [`Image`](https://reactnative.dev/docs/next/image) |

---

For the most recent version of this documentation, visit [https://getstream.io/chat/docs/sdk/react-native/v5/ui-components/message-avatar/](https://getstream.io/chat/docs/sdk/react-native/v5/ui-components/message-avatar/).