# ChannelAvatar

The [`ChannelAvatar`](https://github.com/GetStream/stream-chat-android/blob/main/stream-chat-android-compose/src/main/java/io/getstream/chat/android/compose/ui/components/avatar/ChannelAvatar.kt) displays a channel avatar that adapts based on the channel state and member count:

- If the channel has an image set, it displays the channel image.
- For direct conversations (1:1), it displays the other user's avatar with an optional online indicator.
- For group channels, it displays a stacked layout of member avatars.

## Usage

To use the component, pass the `Channel` object and the current user to `ChannelAvatar`:

```kotlin
ChannelAvatar(
    channel = channel,
    currentUser = currentUser,
    modifier = Modifier.size(36.dp)
)
```

Based on the state of the `Channel` and the number of members, it shows different types of images:

| ![Default ChannelAvatar Component](https://getstream.io/docs-assets/images/07681cb517e0.png) |
| -------------------------------------------------------------------------------------------------------------------- |

## Customization

The `ChannelAvatar` exposes the following properties for customization:

```kotlin
@Composable
fun ChannelAvatar(
    channel: Channel,
    currentUser: User?,
    modifier: Modifier = Modifier,
    showIndicator: Boolean = false,
    showBorder: Boolean = false,
)
```

- `channel`: The channel whose data to display.
- `currentUser`: The current user, used to determine which member's avatar to show in direct conversations.
- `modifier`: Modifier for the root component. Useful for the component size, padding, background and similar.
- `showIndicator`: Whether to display the online status indicator for direct conversations. Defaults to `false`.
- `showBorder`: Whether to show a border around the avatar. Defaults to `false`.

The avatar's appearance (shape, initials style, group layout) is managed internally by the component and adapts to the current theme.

<Admonition type="tip">

For deeper customization of channel avatar rendering, you can override the `ChatComponentFactory#ChannelAvatar` method. See the [Component Factory](https://getstream.io/chat/docs/sdk/android/compose/general-customization/component-factory/) page for details.

</Admonition>


---

This page was last updated at 2026-09-04T17:22:02.915Z.

For the most recent version of this documentation, visit [https://getstream.io/chat/docs/sdk/android/compose/utility-components/channel-avatar/](https://getstream.io/chat/docs/sdk/android/compose/utility-components/channel-avatar/).