Overview
CometChatGroupMembers
is a Component that displays all users added or invited to a group, granting them access to group discussions, shared content, and collaborative features. Group members can communicate in real-time via messaging, voice and video calls, and other activities. They can interact, share files, and join calls based on group permissions set by the administrator or owner.

Usage
Integration
The following code snippet illustrates how you can directly incorporate the Group Members component into your Application.Actions
Actions dictate how a component functions. They are divided into two types: Predefined and User-defined. You can override either type, allowing you to tailor the behavior of the component to fit your specific needs.1. onSelect
TheonSelect
action is activated when you select the done icon while in selection mode. This returns a list of all the group members that you have selected.
This action does not come with any predefined behavior. However, you have the flexibility to override this event and tailor it to suit your needs using the following code snippet.
2. onItemClick
TheonItemClick
event is activated when you click on the Group Members List item. This action does not come with any predefined behavior. However, you have the flexibility to override this event and tailor it to suit your needs using the following code snippet.
3. onEmpty
This action allows you to specify a callback function to be executed when a certain condition, typically the absence of data or content, is met within the component or element.4. onError
This action doesn’t change the behavior of the component but rather listens for any errors that occur in the Group Members component.Filters
Filters allow you to customize the data displayed in a list within a Component. You can filter the list based on your specific criteria, allowing for a more customized. Filters can be applied using RequestBuilders of Chat SDK.1. GroupMembersRequestBuilder
The GroupMembersRequestBuilder enables you to filter and customize the group members list based on available parameters in GroupMembersRequestBuilder. This feature allows you to create more specific and targeted queries when fetching groups. The following are the parameters available in GroupMembersRequestBuilderMethods | Type | Description |
---|---|---|
setLimit | number | sets the number of group members that can be fetched in a single request, suitable for pagination |
setSearchKeyword | String | used for fetching group members matching the passed string |
setScopes | Array<String> | used for fetching group members based on multiple scopes |
2. SearchRequestBuilder
The SearchRequestBuilder uses GroupMembersRequestBuilder enables you to filter and customize the search list based on available parameters in GroupMembersRequestBuilder. This feature allows you to keep uniformity between the displayed Group Members List and searched Group Members List. ExampleEvents
Events are emitted by aComponent
. By using event you can extend existing functionality. Being global events, they can be applied in Multiple Locations and are capable of being Added or Removed.
Events emitted by the Group Members component is as follows.
Event | Description |
---|---|
ccGroupMemberBanned | Triggers when the group member banned from the group successfully |
ccGroupMemberKicked | Triggers when the group member kicked from the group successfully |
ccGroupMemberScopeChanged | Triggers when the group member scope is changed in the group |
Customization
To fit your app’s design requirements, you can customize the appearance of the Group Members component.Style
Using CSS you can customize the look and feel of the component in your app like the color, size, shape, and fonts.
Functionality
These are a set of small functional customizations that allow you to fine-tune the overall experience of the component. With these, you can change text, set custom icons, and toggle the visibility of UI elements.Property | Description | Code |
---|---|---|
Hide Search | Hides the default search bar. | hideSearch={true} |
Hide Error | Hides the default and custom error view passed in errorView prop. | hideError={true} |
Hide Kick Member Option | Hides the option to kick a member from the group. | hideKickMemberOption={true} |
Hide Ban Member Option | Hides the option to ban a member from the group. | hideBanMemberOption={true} |
Hide Scope Change Option | Hides the option to change the scope of a group member. | hideScopeChangeOption={true} |
Hide User Status | Hides the user’s online/offline status indicator. | hideUserStatus={true} |
Group | The group for which members are being fetched. | group={chatGroup} |
Search Keyword | The keyword used to filter the group members list. | searchKeyword="admin" |
Selection Mode | Selection mode to use for the default list item view. | selectionMode={SelectionMode.multiple} |
Show Scrollbar | Controls the visibility of the scrollbar in the list. | showScrollbar={true} |
Loading View | A custom view to display during the loading state. | loadingView={<LoadingSpinner />} |
Error View | Custom view for the error state of the component. | errorView={<ErrorComponent />} |
Empty View | A custom view to display when no group members are available in the list. |
Advanced
For advanced-level customization, you can set custom views to the component. This lets you tailor each aspect of the component to fit your exact needs and application aesthetics. You can create and define your views, layouts, and UI elements and then incorporate those into the component.ItemView
With this property, you can assign a custom ListItem to the Group Members Component. Shown below is the default chat interface.

TitleView
The customized chat interface is displayed below.
SubtitleView
You can customize the subtitle view for each group members to meet your requirements. Shown below is the default chat interface.

LeadingView
The customized chat interface is displayed below.
TrailingView
You can customize the trailing view for each group members to meet your requirements. Shown below is the default chat interface.

HeaderView
You can set the Custom headerView to add more options to the Group Members component. The customized chat interface is displayed below.
Options
You can set the Custom options to the Group Members component. The customized chat interface is displayed below.