Components | Description |
---|---|
CometChatList | A reusable container component having title, search box, customisable background and a list view. |
CometChatListItem | A component that renders data obtained from a User object on a Tile having a title, subtitle, leading and trailing view. |
onSelect
action is activated when you select the done icon while in selection mode. This returns a list of all the users 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.
OnItemClick
event is activated when you click on the UserList 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.
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 | boolean | used for fetching all those users who are not blocked by the logged in user |
friendsOnly | boolean | used for fetching only those users in which logged in user is a member |
setRoles | List<String> | used for fetching users containing the passed tags |
setTags | List<String> | used for fetching users containing the passed tags |
withTags | boolean | used for fetching users containing tags |
setStatus | String | used for fetching users by their status online or offline |
setUIDs | List<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 CometChatUserEvents
The Users
component does not produce any events directly.
Property | Description | Code |
---|---|---|
Hide Search | Hides the default search bar. | hideSearch={true} |
Show Section Header | Displays an alphabetical section header for the user list. | showSectionHeader={true} |
Hide Error | Hides both the default and custom error view passed in errorView prop. | hideError={true} |
Hide User Status | Hides the user’s online/offline status indicator. | hideUserStatus={true} |
Show Scrollbar | Controls the visibility of the scrollbar in the list. | showScrollbar={true} |
Active User | The user to be highlighted in the users list. | activeUser={chatUser} |
Search Keyword | The search keyword used to filter the user list. | searchKeyword="Alice" |
Section Header Key | The property on the user object used to extract the section header character. | sectionHeaderKey={getName} |
Selection Mode | Selection mode to use for the default trailing view. | selectionMode={SelectionMode.multiple} |
Loading View | A custom view to display during the loading state. | loadingView={<>Custom Loading View</>} |
Empty View | A custom view to display when no users are available in the list. | emptyView={<>Custom Empty View</>} |
Error View | A custom view to display when an error occurs. | errorView={<>Custom Error View</>} |