Components | Description |
---|---|
CometChatList | a reusable container component having title, search box, customisable background and a List View |
ListItem | a component that renders data obtained from a User object on a Tile having a title, subtitle, leading and trailing view |
App.tsx
file.
onSelection
event is activated when you select the done icon in the Menubar 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.
onItemPress
event is activated when you press 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.
onItemLongPress
event is activated when you Long Press 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.
onBack
function is built to respond when you tap the back button in the Toolbar of the activity.
By default, this action has a predefined behavior: it simply closes the current activity. However, the flexibility of CometChat UI Kit allows you to override this standard behavior according to your application’s specific requirements. You can define a custom action that will be performed instead when the back button is pressed.
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 |
UsersStyle
to the Users Component to customize the styling.
Property | Description | Code |
---|---|---|
background | Used to set the background color | background?: string |
border | Used to set border width | border?: BorderStyleInterface |
borderRadius | Used to set border radius | borderRadius?: number |
titleFont | Used to set the title font | titleFont?: FontStyleInterface |
titleColor | Used to set the color of the title | titleColor?: string |
backIconTint | Used to set the tint for back icon | backIconTint?: string |
searchBorder | Used to set the border for the search box | searchBorder?: BorderStyleInterface |
searchBorderRadius | Used to set the border radius of the search box | searchBorderRadius?: number |
searchBackground | Used to set the background color for the search box | searchBackground?: string |
searchTextFont | Used to set the font for the search box | searchTextFont?: FontStyleInterface |
searchTextColor | Used to set the color for the search box text | searchTextColor?: string |
searchIconTint | Used to set the color of the search icon in the search box | searchIconTint?: string |
SearchBorderWidth | Used to set the border width of the search box | setSearchBorderWidth(int) |
loadingIconTint | Used to set the color of the icon shown while the list of group members is being fetched | loadingIconTint?: string |
emptyTextFont | Used to set the font for the empty state (when user list is empty) | searchTextFont?: FontStyleInterface |
emptyTextColor | Used to set the text color for the empty state (when user list is empty) | searchTextColor?: string |
onlineStatusColor | Used to set the color of the status indicator shown if a group member is online | onlineStatusColor?: string |
separatorColor | Used to set the color of the divider separating the user items | separatorColor?: string |
sectionHeaderTextFont | Used to set the font for the section header | sectionHeaderTextFont?: FontStyleInterface |
sectionHeaderTextColor | Used to set the color for the section header text | sectionHeaderTextColor?: string |
Avatar
component in the Users Component, you can use the following code snippet. For further insights on Avatar
Styles refer
Property | Description | Code |
---|---|---|
title | Used to set title in the app bar | title?: string; |
searchPlaceholderText | Used to set search placeholder text | searchPlaceholderText?: string; |
backButtonIcon | Used to set back button icon | backButtonIcon?: ImageURISource |
showBackButton | Used to toggle visibility for back button | showBackButton?: boolean |
searchBoxIcon | Used to set search Icon in the search field | searchBoxIcon?: ImageURISource |
hideSearch | Used to toggle visibility for search box | hideSearch?: boolean |
hideError | Used to hide error on fetching users | hideError?: boolean |
hideSeparator | Used to hide the divider separating the user items | hideSeparator?: boolean |
disableUsersPresence | Used to control visibility of user indicator shown if user is online | disableUsersPresence?: boolean |
selectionIcon | Used to override the default selection complete icon | selectionIcon?: ImageURISource |
emptyStateText | Used to set a custom text response when fetching the users has returned an empty list | emptyStateText?: string |
errorStateText | Used to set a custom text response when some error occurs on fetching the list of users | errorStateText?: string |
LoadingStateView
to match the loading view of your app.
EmptyStateView
using EmptyStateView
to match the empty view of your app.