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

AvatarGroup

AvatarGroup renders a composite avatar layout that arranges multiple avatar items in a grid-style formation. It supports 1 to 4+ items and automatically adjusts the layout based on the number of items provided.

The component is used by ChannelAvatar for group channel representations. A higher-level UserAvatarGroup wrapper is also available for convenience when working with user objects.

Layout Rules

Item CountLayout
1Single avatar + people icon placeholder
2Two avatars side by side (top-start, bottom-end)
3Three avatars (top-center, bottom-start, bottom-end)
4Four avatars in a 2×2 grid
5+First two avatars + a badge count showing the remaining count

Usage

import { AvatarGroup, Avatar } from "stream-chat-react-native";

<AvatarGroup
  size="xl"
  items={[
    <Avatar size="md" imageUrl="https://example.com/a.png" />,
    <Avatar size="md" imageUrl="https://example.com/b.png" />,
    <Avatar size="md" imageUrl="https://example.com/c.png" />,
  ]}
/>;

Props

size (required)

The overall size of the avatar group container.

TypeValues
string'lg' | 'xl' | '2xl'

Size mapping:

SizeContainer Dimensions
2xl64 × 64
xl48 × 48
lg44 × 44

items (required)

Array of React nodes (typically Avatar components) to arrange in the group layout. The component automatically selects the layout based on the array length.

Type
ReactNode[]

UserAvatarGroup

UserAvatarGroup is a convenience wrapper around AvatarGroup that accepts an array of user objects instead of raw React nodes. It automatically renders each user as a UserAvatar and adds an optional OnlineIndicator.

Usage

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

<UserAvatarGroup users={[user1, user2, user3]} size="xl" showOnlineIndicator />;

Props

users (required)

Array of user objects to display in the avatar group.

Type
UserResponse[]

size (required)

The overall size of the avatar group container. Same as AvatarGroup.size.

TypeValues
string'lg' | 'xl' | '2xl'

showOnlineIndicator

Whether to display an online presence indicator in the top-right corner of the group.

TypeDefault
booleantrue