Skip to main content
The CometChatGroupMembers component displays all members of a group with their roles (owner, admin, moderator, participant). It supports member management actions like kick, ban, and role changes based on the logged-in user’s permissions.
CometChatGroupMembers showing a list of group members with their avatars, names, and role badges indicating owner, admin, moderator, and participant status

Where It Fits

CometChatGroupMembers displays all members of a specific group. It’s typically accessed from group details or settings screens.
CometChatGroupMembers displaying group members in a navigation context with search functionality and member details

Minimal Render

CometChatGroupMembers showing minimal render with default configuration displaying member list

Filtering

Use GroupMembersRequest.GroupMembersRequestBuilder to filter which members appear in the list.

Filter Recipes


Actions and Events

Callback Props

onItemClick

Fires when a user taps on a member. Use this to start a direct chat or view profile.

onItemLongClick

Fires when a user long-presses on a member. Use this to show member options.

onBack

Fires when the back button is pressed.

onSelection

Fires when members are selected in selection mode.

onError

Fires when an error occurs while loading members.

onEmpty

Fires when the member list is empty.

onLoad

Fires when members are successfully loaded.

Actions Reference

Global UI Events

SDK Events (Real-Time, Automatic)


Custom View Slots

set(titleView:)

Replaces the default title view (member name) with a custom implementation.

set(leadingView:)

Replaces the default leading view (avatar) with a custom implementation.

subtitleView

Customize the subtitle area below the member name.

tailView

Customize the right side of the member row (role badge). Note: The setter method is set(trailView:).

Styling

Style Hierarchy

  1. Global styles (CometChatGroupMembers.style) apply to all instances
  2. Instance styles override global for specific instances

Global Level Styling

Instance Level Styling

CometChatGroupMembers with custom styling showing modified background color, title appearance, and list item styling

Key Style Properties

Customization Matrix


Props

All props are optional except group. Sorted alphabetically.

avatarStyle

Customizes the appearance of member avatars in the list.

group (required)

The group whose members to display.

groupMembersRequestBuilder

Custom request builder for filtering members.

hideBackIcon

Hides the back button in the navigation bar.

hideBanMemberOption

Hides the ban member option in swipe actions.

hideErrorView

Hides the error state view.

hideKickMemberOption

Hides the kick member option in swipe actions.

hideLoadingState

Hides the loading state indicator.

hideNavigationBar

Hides the entire navigation bar.

hideScopeChangeOption

Hides the role change option in swipe actions.

hideSearch

Hides the search bar.

hideUserStatus

Hides online/offline status indicators.

selectionMode

Sets the selection mode for multi-select functionality.

statusIndicatorStyle

Customizes the appearance of online/offline status indicators.

Events


Methods

Swipe Action Methods

set(options:)

Sets custom swipe actions for group member list items, replacing the default options. These options appear when the user swipes on a member cell.

add(options:)

Adds additional swipe actions to the existing default options.

Data Manipulation Methods

add(groupMember:)

Adds a new group member to the list.

update(groupMember:)

Updates an existing group member in the list.

remove(groupMember:)

Removes a group member from the list.

insert(groupMember:at:)

Inserts a group member at a specific index in the list.

clearList()

Removes all group members from the list.

size()

Returns the number of group members currently in the list.

Selection Properties

onSelectedItemProceed

Callback that fires when the user proceeds with selected members in selection mode. This is typically triggered when the user taps a “Done” or “Proceed” button after selecting members.

Custom Swipe Options

Add custom actions when swiping on a member:
CometChatGroupMembers showing custom swipe options with Remove and Message action buttons revealed on a member row

Custom Menu Buttons

Add buttons to the navigation bar:
CometChatGroupMembers showing custom navigation bar menu with an add member button in the top right corner

Common Patterns

Admins and moderators only

Hide management options for participants

Custom empty state

Multi-select members