Skip to main content
Version: v4

User Member Wrapper

The CometChatUserMemberWrapper is a UI component that combines the features of CometChatUsers and CometChatGroupMemberWrapper. It's designed to work behind the scenes in the CometChatMessageComposer to show a simple and smart list of suggestions when users want to mention others in their messages. This makes it easier for users to engage with each other and manage group conversations in a smooth and convenient way.

Properties

userMemberListType

Determines the type of the user member list.

NameTypeDescription
userMemberListTypeUserMemberListTypeEnum that can have one of two values: UserMemberListType.USERS or UserMemberListType.GROUPS

onItemClick

Event handler for item click events.

NameTypeDescription
onItemClick(userMember: CometChat.User | CometChat.GroupMember) => voidEvent handler method that triggers when a user or group member is clicked

listItemView

Custom view for the item list.

NameTypeDescription
listItemViewviewCustom view for list items

avatarStyle

Style properties for the avatar component.

NameTypeDescription
avatarStyleAvatarStyleStyle properties for the avatar

statusIndicatorStyle

Style properties for the status indicator.

NameTypeDescription
statusIndicatorStyleobjectStyle properties for the status indicator

searchKeyword

Keyword for searching user members.

NameTypeDescription
searchKeywordstringKeyword for searching user members

group

The group of which members to be listed.

NameTypeDescription
groupCometChat.GroupThe group of which members are to be listed

subtitleView

Custom view for the subtitle.

NameTypeDescription
subtitleViewviewCustom view for the subtitle

usersRequestBuilder

Request builder for fetching users.

NameTypeDescription
usersRequestBuilderCometChat.UsersRequestBuilderClass that allows you to set various parameters to fetch the users

disableUsersPresence

To disable the display of user presence.

NameTypeDescription
disableUsersPresencebooleanWhen set to true, users presence will not be displayed

userPresencePlacement

Placement of the user presence.

NameTypeDescription
userPresencePlacementUserPresencePlacementDetermines the placement of the user presence

hideSeperator

To hide the separator between list items.

NameTypeDescription
hideSeperatorbooleanWhen set to true, the separator will be hidden

loadingStateView

Custom view for the loading state.

NameTypeDescription
loadingStateViewviewCustom view for the component's loading state

onEmpty

Event handler for empty state.

NameTypeDescription
onEmpty() => voidEvent handler method for empty state

onError

Event handler for error state.

NameTypeDescription
onError(error: CometChat.CometChatException) => voidEvent handler method for error state

groupMemberRequestBuilder

Request builder for fetching group members.

NameTypeDescription
groupMemberRequestBuilderCometChat.GroupMembersRequestBuilderClass that allows you to set various parameters to fetch the group members

loadingIconUrl

URL for the loading icon.

NameTypeDescription
loadingIconUrlstringURL for the loading icon

disableLoadingState

To disable the loading state.

NameTypeDescription
disableLoadingStatebooleanWhen set to true, the loading state will be disabled

Usage

<CometChatUserMemberWrapperComponent
userMemberListType="userMemberListTypeEnum.USERS"
onItemClick="onItemClick"
listItemView="listItemView"
avatarStyle="avatarStyle"
statusIndicatorStyle="statusIndicatorStyle"
searchKeyword="searchKeyword"
group="group"
subtitleView="subtitleView"
usersRequestBuilder="usersRequestBuilder"
disableUsersPresence="disableUsersPresence"
userPresencePlacement="userPresencePlacement"
hideSeperator="hideSeperator"
loadingStateView="loadingStateView"
onEmpty="onEmpty"
onError="onError"
groupMemberRequestBuilder="groupMemberRequestBuilder"
loadingIconUrl="loadingIconUrl"
disableLoadingState="disableLoadingState"
></CometChatUserMemberWrapperComponent>