# Message Avatar View

This component renders the user avatar. By default, a circular image is used.

### Customization

You can swap the built-in component with your own by setting `Components.default.avatarView` to your view type.

```swift
Components.default.avatarView = MyChatAvatarView.self
```

<admonition type="note">

You can find more information on how the components configuration works [here](/chat/docs/sdk/ios/v4/uikit/custom-components/).

</admonition>


## Examples

### Square Avatar

First, create a subclass of `ChatAvatarView` and set it according to your needs.

```swift
final class SquareAvatarView: ChatAvatarView {
    override func layoutSubviews() {
        super.layoutSubviews()
        imageView.layer.cornerRadius = 3
    }
}
```

Next, you need to set this custom view to `Components` in the context where your customization takes place.

```swift
Components.default.avatarView = SquareAvatarView.self
```

| Default avatars                                                                             | Square avatars                                                                         |
| ------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------- |
| ![Chat with default message alignment](@chat-sdk/ios/v4/_assets/message-layout-default.png) | ![Chat with square avatar](@chat-sdk/ios/v4/_assets/message-layout-squared-avatar.png) |


---

This page was last updated at 2026-04-17T17:33:37.912Z.

For the most recent version of this documentation, visit [https://getstream.io/chat/docs/sdk/ios/v4/uikit/views/avatar/](https://getstream.io/chat/docs/sdk/ios/v4/uikit/views/avatar/).