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 AppBar while in selection mode. This returns a list of all the Groups 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 Group 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 Group 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 press the back button in the AppBar. The back button is only displayed when the prop showBackButton
is set to true.
By default, this action does not have a 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 groups that can be fetched in a single request, suitable for pagination |
setSearchKeyword | string | used for fetching groups matching the passed string |
joinedOnly | boolean | to fetch only joined groups |
friendsOnly | boolean | used for fetching only those users in which logged in user is a member |
setTags | Array<string> | used for fetching groups containing the passed tags |
withTags | boolean | used to fetch tags data along with the list of groups |
CometChatGroupEvents
.
The Groups component does not produce any events directly.
GroupsStyle
to the Groups Component to customize the styling.
Property | Description | Code |
---|---|---|
border | Used to set border | border?: BorderStyleInterface, |
borderRadius | Used to set border radius | borderRadius?: number; |
backgroundColor | Used to set background colour | background?: string; |
height | Used to set height | height?: number | string; |
width | Used to set width | width?: number | string; |
titleFont | Used to customise the font of the title in the app bar | titleFont?: FontStyleInterface; |
titleColor | Used to customise the color of the title in the app bar | titleColor?: string; |
backIconTint | Used to set the tint for the back button | backIconTint?: string |
searchBorder | Used to set search box border | searchBorder?: BorderStyleInterface, |
searchBorderRadius | Used to set search box border radius | searchBorderRadius?: number; |
searchBackgroundColor | Used to set search box background colour | searchBackgroundColor?: string; |
searchTextFont | Used to customise the font of the search box in the app bar | searchTextFont?: FontStyleInterface; |
searchTextColor | Used to customise the color of the search box in the app bar | searchTextColor?: string; |
searchPlaceholderTextColor | Used to set the color of the placeholder text in the search box | searchPlaceholderTextColor?: string; |
searchIconTint | Used to set the tint for the search icon tint | searchIconTint?: string |
emptyTextColor | Used to empty state text color | emptyTextColor?: string |
emptyTextFont | Used to empty state text font | emptyTextFont?: FontStyleInterface |
errorTextColor | Used to set the font style of the response text shown in case some error occurs while fetching the list of users | errorTextColor?: string; |
errorTextFont | Used to set the font style of the response text shown in case some error occurs while fetching the list of users | errorTextFont?: FontStyleInterface; |
subtitleTextColor | Used to set the color for group item subtitle | subtitleTextColor?: string; |
subtitleTextFont | Used to set the font style for group item subtitle | subtitleTextFont?: FontStyleInterface; |
separatorColor | Used to set the color of the divider separating the group member items | separatorColor?: string; |
loadingIconTint | Used to set the color of the icon shown while the list of users is being fetched | loadingIconTint?: string; |
privateGroupIconBackground | Sets background image of private group Icon | privateGroupIconBackground?: ImageType; |
passwordGroupIconBackground | Sets background image of protected group Icon | passwordGroupIconBackground?: ImageType; |
Avatar
component in the Groups 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 |
errorStateText | Used to set a custom text response when some error occurs on fetching the list of groups | errorStateText?: string |
emptyStateText | Used to set a custom text response when fetching the groups has returned an empty list | emptyStateText?: string |
searchBoxIcon | Used to set search Icon in the search field | searchBoxIcon?: ImageType |
privateGroupIcon | Used to set the private group Icon | privateGroupIcon?: ImageType |
passwordGroupIcon | Used to set the protected group Icon | passwordGroupIcon?: ImageType |
hideSearch | Used to toggle visibility for search box | hideSearch?: boolean |
hideError | Used to hide error on fetching groups | hideError?: boolean |
hideSeperator | Used to hide the divider separating the group items | hideSeperator?: boolean |
selectionMode | set the number of groups that can be selected, SelectionMode can be single, multiple or none. | selectionMode? SelectionMode |
hideSubmitIcon | Used to hide the selection submit icon | hideSubmitIcon?: boolean |
backButtonIcon | Used to set the back button icon | backButtonIcon?: ImageType |
showBackButton | Used to hide or show the back button | showBackButton?: boolean |
LoadingStateView
to match the loading view of your app.
EmptyStateView
using EmptyStateView
prop to match the empty view of your app.