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.

AI Agent Component Spec
AI Agent Component Spec
Where It Fits
CometChatGroupMembers displays all members of a specific group. It’s typically accessed from group details or settings screens.

Minimal Render

Filtering
UseGroupMembersRequest.GroupMembersRequestBuilder to filter which members appear in the list.
Filter Recipes
| Recipe | Code |
|---|---|
| Admins only | .set(scopes: ["admin"]) |
| Admins and moderators | .set(scopes: ["admin", "moderator"]) |
| Search by name | .set(searchKeyword: "john") |
| Limit results | .set(limit: 20) |
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
| Method | Description | Example |
|---|---|---|
set(onItemClick:) | Triggered when a member is tapped | Start direct chat |
set(onItemLongClick:) | Triggered on long press | Show options menu |
set(onBack:) | Triggered when back button is pressed | Custom navigation |
set(onSelection:) | Triggered in selection mode | Multi-select members |
set(onError:) | Triggered when an error occurs | Show error alert |
set(onEmpty:) | Triggered when list is empty | Show empty state |
set(onLoad:) | Triggered when members load | Analytics tracking |
Global UI Events
| Event | Fires when | Payload |
|---|---|---|
ccGroupMemberKicked | A member is kicked | User, Group |
ccGroupMemberBanned | A member is banned | User, Group |
ccGroupMemberScopeChanged | A member’s role is changed | User, Group, MemberScope |
SDK Events (Real-Time, Automatic)
| SDK Listener | Internal behavior |
|---|---|
onGroupMemberKicked | Removes member from list |
onGroupMemberBanned | Removes member from list |
onGroupMemberUnbanned | Updates member info |
onGroupMemberScopeChanged | Updates member role badge |
onMemberAddedToGroup | Adds new member to list |
Custom View Slots
| Slot | Setter Method | Signature | Replaces |
|---|---|---|---|
listItemView | set(listItemView:) | (GroupMember?) -> UIView | Entire member row |
leadingView | set(leadingView:) | (GroupMember?) -> UIView | Avatar / left section |
titleView | set(titleView:) | (GroupMember?) -> UIView | Name / title text |
subtitleView | set(subtitleView:) | (GroupMember?) -> UIView | Role / subtitle text |
trailView | set(trailView:) | (GroupMember?) -> UIView | Right side (role badge) |
emptyStateView | - | UIView | Empty state display |
errorStateView | - | UIView | Error state display |
loadingStateView | - | UIView | Loading state display |
subtitleView
Customize the subtitle area below the member name.tailView
Customize the right side of the member row (role badge). Note: The setter method isset(trailView:).
Styling
Style Hierarchy
- Global styles (
CometChatGroupMembers.style) apply to all instances - Instance styles override global for specific instances
Global Level Styling
Instance Level Styling

Key Style Properties
| Property | Type | Default | Description |
|---|---|---|---|
backgroundColor | UIColor | CometChatTheme.backgroundColor01 | Background color |
titleColor | UIColor | CometChatTheme.textColorPrimary | Navigation title color |
titleFont | UIFont | CometChatTypography.Heading4.medium | Navigation title font |
listItemTitleTextColor | UIColor | CometChatTheme.textColorPrimary | Member name color |
listItemTitleFont | UIFont | CometChatTypography.Heading4.medium | Member name font |
listItemSubTitleTextColor | UIColor | CometChatTheme.textColorSecondary | Subtitle color |
listItemBackground | UIColor | .clear | List item background |
Customization Matrix
| What to change | Where | Property/API | Example |
|---|---|---|---|
| Background color | Style | backgroundColor | UIColor.systemBackground |
| Title appearance | Style | titleColor, titleFont | Custom colors and fonts |
| List item look | Style | listItemBackground | UIColor.white |
| Avatar appearance | Style | avatarStyle | AvatarStyle() with custom radius |
| Hide search | Property | hideSearch | groupMembers.hideSearch = true |
| Hide kick option | Property | hideKickMemberOption | groupMembers.hideKickMemberOption = true |
| Custom row | View Slot | set(listItemView:) | See Custom View Slots |
Props
All props are optional exceptgroup. Sorted alphabetically.
group (required)
The group whose members to display.| Type | Group |
| Required | true |
groupMembersRequestBuilder
Custom request builder for filtering members.| Type | GroupMembersRequest.GroupMembersRequestBuilder? |
| Default | nil |
hideBackIcon
Hides the back button in the navigation bar.| Type | Bool |
| Default | false |
hideBanMemberOption
Hides the ban member option in swipe actions.| Type | Bool |
| Default | false |
hideErrorView
Hides the error state view.| Type | Bool |
| Default | false |
hideKickMemberOption
Hides the kick member option in swipe actions.| Type | Bool |
| Default | false |
hideLoadingState
Hides the loading state indicator.| Type | Bool |
| Default | false |
hideNavigationBar
Hides the entire navigation bar.| Type | Bool |
| Default | false |
hideScopeChangeOption
Hides the role change option in swipe actions.| Type | Bool |
| Default | false |
hideSearch
Hides the search bar.| Type | Bool |
| Default | false |
hideUserStatus
Hides online/offline status indicators.| Type | Bool |
| Default | false |
selectionMode
Sets the selection mode for multi-select functionality.| Type | SelectionMode |
| Default | .none |
Events
| Event | Payload | Fires when |
|---|---|---|
ccGroupMemberKicked | User, Group | A member is kicked |
ccGroupMemberBanned | User, Group | A member is banned |
ccGroupMemberScopeChanged | User, Group, MemberScope | A member’s role is changed |
Custom Swipe Options
Add custom actions when swiping on a member:
Custom Menu Buttons
Add buttons to the navigation bar:
Troubleshooting
| Issue | Solution |
|---|---|
| Empty member list | Ensure group object is valid and has members |
| Management options not showing | Check logged-in user’s permissions (must be admin/owner) |
| Search not working | Verify hideSearch is not set to true |
| Status not showing | Check that hideUserStatus is not set to true |
| Custom views not appearing | Ensure custom view has proper constraints |
Related Components
- Groups - List all groups
- Messages - Display messages in a group
- Add Members - Add new members to a group
- Banned Members - View banned members
- Transfer Ownership - Transfer group ownership