Skip to main content

Overview

CometChatGroupMembers is a list component that renders all members of a specific group. It provides role-based actions (kick, ban, scope change) for admins and moderators, and emits the selected CometChat.GroupMember via onItemClick. Use it inside group details panels or as a standalone member management view.
Live Preview — interact with the default group members list.Open in Storybook ↗
The component handles:
  • Paginated fetching with infinite scroll
  • Real-time membership updates (joins, leaves, kicks, bans, scope changes)
  • Search filtering
  • Role-based action menus (kick, ban, change scope)
  • Selection mode (single/multiple)

Usage

Flat API

Compound Composition

Group Details Example


Filtering

Pass a CometChat.GroupMembersRequestBuilder to groupMemberRequestBuilder to control which members load. Pass the builder instance — not the result of .build(). Refer to GroupMembersRequestBuilder for the full builder API.
The component includes a built-in search bar. When the user types, it fetches matching members from the server. For custom search behavior, pass a searchRequestBuilder:

Filter Recipes


Actions and Events

Callback Props

Events Emitted

This component does not emit any UI events directly. Kick, ban, and scope change actions are handled by internal action handlers that publish their own events.

Events Received

UI events this component subscribes to (published by other components):

SDK Listeners (Automatic)

These SDK listeners are attached internally. The component updates its state automatically — no manual subscription needed:
  • Groups: onGroupMemberJoined, onGroupMemberLeft, onGroupMemberKicked, onGroupMemberBanned, onGroupMemberScopeChanged, onMemberAddedToGroup

Customization

View Props

Use view props to replace sections of the default UI while keeping the component’s behavior intact:

itemView

Replace the entire list item row. Default:
Customized:

subtitleView

Replace the subtitle text. Joined date example. Default:
Customized:

trailingView

Replace the right section. Scope tag example. Default:
Customized:

headerView

Replace the entire header bar.

options

Replace the context menu / hover actions on each member item.

Compound Composition

For full layout control, use sub-components. Omit any sub-component to hide it:
Available sub-components:

CSS Styling

Override design tokens on the component selector:

Props

All props are optional unless marked Required.
View slot props (headerView, loadingView, emptyView, errorView, itemView, leadingView, titleView, subtitleView, trailingView) are convenience props available only on the flat API. The search input is the SearchBar sub-component (with a placeholder prop), not a view slot. In compound composition mode, use the corresponding sub-components directly.

group

Required. The group whose members to display.

groupMemberRequestBuilder

Custom request builder for fetching group members. Controls pagination, filtering, and sorting.

searchRequestBuilder

Custom request builder used specifically when the user searches. Separate from the main builder.

searchKeyword

Initial search keyword to pre-filter members on mount.

hideUserStatus

Hide the online/offline status indicator on member avatars.

hideSearch

Hide the search bar entirely.

hideKickMemberOption

Hide the “Kick Member” option from the action menu (even for admins/owners).

hideBanMemberOption

Hide the “Ban Member” option from the action menu (even for admins/owners).

hideScopeChangeOption

Hide the “Change Scope” option from the action menu (even for admins/owners).

showScrollbar

Show the native scrollbar on the member list.

selectionMode

Enable selection mode for single or multi-select operations.

options

Function that returns context menu options for each member item (shown on hover/swipe). Overrides the default kick/ban/scope options.

onItemClick

Callback when a member item is clicked.

onSelect

Callback when a member is selected or deselected (only fires in selection mode).

onError

Callback when an SDK error occurs during fetch or real-time operations.

onEmpty

Callback when the member list is empty after the initial fetch completes.

onBack

Callback when the back button in the header is clicked.

CSS Selectors


Next Steps

Groups

Browse and select groups

Theming

Customize colors, fonts, and spacing