onBack
is triggered when you press the back button in the app bar. It has a predefined behavior; when clicked, it navigates to the previous activity. However, you can override this action using the following code snippet.
Methods | Type | Description |
---|---|---|
setLimit | number | sets the number users that can be fetched in a single request, suitable for pagination |
setSearchKeyword | string | used for fetching users matching the passed string |
hideBlockedUsers | bool | used for fetching all those users who are not blocked by the logged in user |
friendsOnly | bool | used for fetching only those users in which logged in user is a member |
setRoles | Array<string> | used for fetching users containing the passed tags |
setTags | Array<string> | used for fetching users containing the passed tags |
withTags | bool | used for fetching users containing tags |
setUserStatus | string | used for fetching users by their status online or offline |
setUIDs | Array<string> | used for fetching users containing the passed users |
Component
. 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.
To handle events supported by Users you have to add corresponding listeners by using CometChatUIEventHandler.addUserListener
Events | Description |
---|---|
ccUserBlocked | This will get triggered when the logged in user blocks another user |
ccUserUnblocked | This will get triggered when the logged in user unblocks another user |
CometChatUsers
Component to customize the styling.
Property | Description | Code |
---|---|---|
hideHeader | Used to toggle visibility for the toolbar/header | hideHeader?: boolean |
showBackButton | Used to toggle visibility for back button | showBackButton?: boolean |
hideSearch | Used to toggle visibility for search box | hideSearch?: boolean |
hideError | Used to hide error on fetching users | hideError?: boolean |
stickyHeaderVisibility | Used to hide section headers | stickyHeaderVisibility?: boolean |
selectionMode | This method determines the selection mode for users, enabling users to select either a single user or multiple users at once. | selectionMode={SelectionMode.multiple} |
hideSubmitButton | Used to toggle the visibility of the submit button when selectionMode is enabled. | hideBackButton={true} |
searchPlaceholderText | Used to set search placeholder text | searchPlaceholderText?: string; |
hideLoadingState | Used to toggle visibility for Loading state | hideLoadingState?: boolean |
usersStatusVisibility | Used to toggle visibility for User status | usersStatusVisibility?: boolean |
searchKeyword | Keyword used to fetch initial user list. | searchKeyword?: string |
title | Title for the header. | title?: string |