Skip to main content
FieldValue
Package@cometchat/chat-uikit-react
Key componentsCometChatGroups, CometChatGroupMembers, CometChatCreateGroup, CometChatJoinGroup, CometChatAddMembers, CometChatBannedMembers, CometChatTransferOwnership
InitCometChatUIKit.init(UIKitSettings) then CometChatUIKit.login("UID")
FeaturesCreate public/private/password-protected groups, manage members, roles, ownership transfer
Sample appGitHub
RelatedAll Guides
This guide covers the full group lifecycle: creating groups, joining them, managing members, changing roles, and transferring ownership. Before starting, complete the Getting Started guide for your framework.

Components

Component / ClassRole
CometChatCreateGroupCreates new groups with different types and settings
CometChatJoinGroupHandles joining public and password-protected groups
CometChatGroupMembersDisplays and manages group member lists
CometChatAddMembersAdds new members to existing groups
CometChatBannedMembersManages banned members and unban operations
CometChatTransferOwnershipTransfers group ownership to other members

Integration Steps

1. Create Group

Build a form that collects a group name, type (public/private/password), and optional password. On submit, generate a unique GUID, call CometChat.createGroup(), and emit ccGroupCreated so the rest of the UI updates. File: CometChatCreateGroup.tsx

2. Join Group

Handle joining for both public and password-protected groups. Call CometChat.joinGroup() with the group’s GUID, type, and password (if applicable). On success, emit ccGroupMemberJoined to update the member list across the app. File: CometChatJoinGroup.tsx

3. View Group Members

Render the member list for a group using CometChatGroupMembers. Pass onItemClick to handle member selection and options to add context-menu actions like “View Profile”. File: CometChatHome.tsx

4. Add Members

Let admins select users and add them to the group. Collect selected UIDs, call CometChat.addMembersToGroup(), and emit ccGroupMemberAdded so the member list refreshes. File: CometChatAddMembers.tsx

5. Ban Members

Fetch the list of banned members using BannedMembersRequestBuilder. This component displays banned users and provides unban functionality for group admins. File: CometChatBannedMembers.tsx

6. Change Member Scope

Promote or demote a member by calling CometChat.updateGroupMemberScope(). Pass the member’s UID, the new scope (admin, moderator, or participant), and the group GUID. Emit ccGroupMemberScopeChanged so the UI reflects the role change. File: CometChatHome.tsx

7. Transfer Ownership

Let the current owner select a member and transfer ownership via CometChat.transferGroupOwnership(). The group object is cloned and updated locally, then ccOwnershipChanged is emitted to sync the UI. File: CometChatTransferOwnership.tsx

Feature Matrix

FeatureComponent / MethodFile
Create groupCometChatCreateGroupCometChatCreateGroup.tsx
Join groupCometChatJoinGroupCometChatJoinGroup.tsx
View membersCometChatGroupMembersCometChatHome.tsx
Add membersCometChatAddMembersCometChatAddMembers.tsx
Ban membersCometChatBannedMembersCometChatBannedMembers.tsx
Change scopeupdateGroupMemberScope()CometChatHome.tsx
Transfer ownershipCometChatTransferOwnershipCometChatTransferOwnership.tsx
Group eventsCometChatGroupEventsMultiple files

Next Steps

Groups

Display and manage group lists.

Group Members

Display and manage group member lists.

All Guides

Browse all feature and formatter guides.

Sample App

Full working sample application on GitHub.