This is beta documentation for Stream Chat React Native SDK v9. For the latest stable version, see the latest version (v8) .

ChannelAvatar

ChannelAvatar renders the avatar for a chat channel. It intelligently selects the appropriate avatar representation based on channel data:

  • If the channel has a custom image (channel.data.image), it renders a base Avatar with that image.
  • If the channel is a group with multiple members (excluding the current user), it renders a UserAvatarGroup showing members' avatars.
  • For direct message channels (single other member), it renders a UserAvatar.

The component also determines online presence from channel state and shows an online indicator when applicable.

Usage

import { ChannelAvatar } from "stream-chat-react-native";

<ChannelAvatar channel={channel} size="xl" showBorder />;

Props

channel (required)

The Stream Chat Channel instance to render the avatar for. The component reads channel.data.image, channel.state.members, and channel.cid to determine the rendering strategy.

Type
Channel

showOnlineIndicator

Whether to display an online presence indicator. Defaults to the channel's online presence status derived from the useChannelPreviewDisplayPresence hook.

TypeDefault
booleanOnline presence from channel state

size

The size of the avatar.

TypeDefaultValues
string'xl''lg' | 'xl' | '2xl'

showBorder

Whether to show a border around the avatar.

TypeDefault
booleantrue