> ## Documentation Index
> Fetch the complete documentation index at: https://cometchat-22654f5b-docs-llms-scoped-indexes.mintlify.site/llms.txt
> Use this file to discover all available pages before exploring further.

# Avatar

> Avatar — CometChat documentation.

The `CometChatAvatar` component displays user and group avatars. For users and groups , it displays either an image or the user's avatar and falls back to the first two letters of the username.

##

## Methods

| Methods | Description |
| - | - |
| `set(cornerRadius : CGFloat)` | Sets the `cornerRadius` |
| `set(borderColor : UIColor)` | Sets the `borderColor` |
| `set(backgroundColor : UIColor)` | Sets the `backgroundColor` |
| `set(borderWidth : CGFloat)` | Sets the `borderWidth` |
| `setAvatar(avatarUrl: String)` | Sets the `avatarUrl` |
| `setAvatar(avatarUrl: String, with name: String)` | Sets the `avatarUrl` with user name initials |
| `set(outerView: Bool)` | Enables the outerView |
| set(font : UIFont) | Sets the font for Initials |
| set(fontColor: UIColor) | Sets the text color for Initials |

## Usage of Methods

<Tabs>
  <Tab title="Swift">
    ```swift theme={null}
    avatar.set(cornerRadius : 50)
    			.set(borderWidth : 2)
    			.set(borderColor: [UIColor: red galaxy color])
    		  .setAvatar(user: user.avatar)
          .setOuterViewSpacing( ... )
          .setOuterView ( Color: black )
    ```
  </Tab>
</Tabs>

<Tabs>
  <Tab title="Swift">
    ```swift theme={null}
    avatar.set(outerView : NO)
    			.set(cornerRadius : 50)
    			.set(text: ....)
          .set(textColor: ...)
          .set(textFont: ...)
    		  .setAvatar(user: user.avatar)
          .setAvatarWith (100)
          .setAvatarHeight(100)
          .setAvatarBackgroundColor (UIColor.blackColor)
    ```
  </Tab>
</Tabs>


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.