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 Group 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 the group
object along with the boolean flag selected
to indicate if the group was selected or unselected.
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 Group List 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 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. |
setTags | Array<String> | used for fetching groups containing the passed tags |
withTags | boolean | used to fetch tags data along with the list of groups |
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 Groups you have to add corresponding listeners by using 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?: string, |
borderRadius | Used to set border radius | borderRadius?: string; |
background | Used to set background colour | background?: string; |
height | Used to set height | height?: string; |
width | Used to set width | width?: string; |
titleTextFont | Used to customise the font of the title in the app bar | titleTextFont?: string; |
titleTextColor | Used to customise the color of the title in the app bar | titleTextColor?: string; |
emptyStateTextFont | Used to set the font style of the response text shown when fetchig the list of groups has returned an empty list | emptyStateTextFont?: string; |
emptyStateTextColor | Used to set the color of the response text shown when fetchig the list of groups has returned an empty list | emptyStateTextColor?: string; |
errorStateTextFont | Used to set the font style of the response text shown in case some error occurs while fetching the list of groups | errorStateTextFont?: string; |
errorStateTextColor | Used to set the font style of the response text shown in case some error occurs while fetching the list of groups | errorStateTextColor?: string; |
loadingIconTint | Used to set the color of the icon shown while the list of groups is being fetched | loadingIconTint?: string; |
separatorColor | Used to set the color of the divider separating the group member items | separatorColor?: string; |
boxShadow | Sets shadow effects around the element | boxShadow?: string; |
privateGroupIconBackground | Sets background color of private group Icon | privateGroupIconBackground?: string; |
passwordGroupIconBackground | Sets background color of protected group Icon | passwordGroupIconBackground?: string; |
searchIconTint | Used to set the color of the search icon in the search box | searchIconTint?: string; |
searchBorder | Used to set the border of the search box | searchBorder?: string; |
searchBorderRadius | Used to set the border radius of the search box | searchBorderRadius?: string; |
searchBackground | Used to set the background color of the search box | searchBackground?: string; |
searchPlaceholderTextFont | Used to set the font of the placeholder text in the search box | searchPlaceholderTextFont?: string; |
searchPlaceholderTextColor | Used to set the color of the placeholder text in the search box | searchPlaceholderTextColor?: string; |
searchTextFont | Used to set the font of the text in the search box | searchTextFont?: string; |
searchTextColor | Used to set the color of the text in the search box | searchTextColor?: string; |
subTitleTextFont | Used to customise the font of the subtitle text. | subTitleTextFont?: string; |
subTitleTextColor | Used to customise the color of the subtitle text. | subTitleTextColor?: string; |
Avatar
component in the Groups Component, you can use the following code snippet. For further insights on Avatar
Styles refer
List Item
component in the Groups
Component, you can use the following code snippet. For further insights on List Item
Styles refer
Property | Description | Code |
---|---|---|
title | Used to set title in the app heading | title="Your Custom Title" |
searchPlaceholderText | Used to set search placeholder text | searchPlaceholderText="Your Custom search placeholder text" |
errorStateText | Used to set a custom text response when some error occurs on fetching the list of groups | errorStateText="your custom error state text" |
emptyStateText | Used to set a custom text response when fetching the groups has returned an empty list | emptyStateText="your custom empty state text" |
searchIconURL | Used to set search Icon in the search field | searchIconURL="Your Custom search icon" |
loadingIconURL | Used to set loading Icon | loadingIconURL="your custom loading icon url" |
privateGroupIcon | Used to set the private group Icon | privateGroupIcon='Custom Private Group Icon' |
passwordGroupIcon | Used to set the protected group Icon | passwordGroupIcon='Custom protected Group Icon' |
hideSearch | Used to toggle visibility for search box | hideSearch={true}" |
hideError | Used to hide error on fetching groups | hideError={true} |
hideSeparator | Used to hide the divider separating the group items | hideSeparator={true} |
activeGroup | Used to set the active group | activeGroup={chatGroup} |
titleAlignment | Alignment of the heading text for the component | titleAlignment={TitleAlignment.center} |
selectionMode | set the number of groups that can be selected, SelectionMode can be single, multiple or none. | selectionMode={SelectionMode.multiple} |
loadingStateView
to match the loading view of your app.
Default:
EmptyStateView
using emptyStateView
to match the empty view of your app.
Default:
ErrorStateView
using errorStateView
to match the error view of your app.
Default: