type
and category
of a message, the appearance and behavior of the header, content, and footer sections of the message bubble,
type
you can set the type of CometChatMessage, This will map your MessageTemplate to the corresponding CometChatMessage. You can set the MessageTemplates Type using the following code snippet.
category
you can set the category of a MessageTemplate. This will create a MessageTemplate with the specified category and link it with a CometChatMessage of the same category.
Please refer to our guide on Message Categories for a deeper understanding of message categories.
headerView
method allows you to assign a custom header view to the Message Bubble. By default, it is configured to display the sender’s name.
contentView
method allows you to assign a custom content view to the Message Bubble. By default, it displays the Text Bubble, Image Bubble, File Bubble, Audio Bubble, or Video Bubble depending on the message type.
footerView
method allows you to assign a custom Footer view to the Message Bubble. By default it shows thr reactions for the message bubble.
bottomView
method allows you to assign a custom Bottom view to the Message Bubble. By defuault is has buttons such as link previews or a ‘load more’ button for long messages.
bubbleView
method allows you to assign a custom Bubble view to the Message Bubble. By default, headerView, contentView, statusInfoView and footerView together form a message bubble.
statusInfoView
method allows you to assign a custom status info view to the Message Bubble. By default, it displays the receipt and timestamp.
options
lets you set the list of actions that a user can perform on a message. This includes actions like reacting to, editing, or deleting a message.
templates
prop of CometChatMessageList
component.
headerView
method of MessageTemplate allows you to add custom views to the header of your message bubbles. In the example below, we will add a custom header view of every text message in the MessageList.
contentview
method of MessageTemplate allows you to add a custom view to the content of your message bubbles. In the example below, we will add a custom layout to the content view of every text message in the MessageList.
bottomView
method of MessageTemplate allows you to add a custom button view to your message bubbles. In the example below, we will add a custom bottom view to every text message in the MessageList.
footerView
method of MessageTemplate allows you to add a footer view to your message bubbles. In the example below, we will add a custom footer view to every text message in the MessageList.
bubbleView
method of MessageTemplate allows you to add a bubble view to your message bubbles. In the example below, we will add a custom bubble view to the text message in the MessageList.
statusInfoView
method of MessageTemplate allows you to add a status info view to your message bubbles. In the example below, we will add a custom status info view to every text message in the MessageList.
options
method in the MessageTemplate allows you to customize the options that appear in the action sheet when a message is long-pressed. By default, CometChat UI Kit provides a set of options like “Thread Reply”, “Copy” ,“Edit”, and “Delete”.
However, if you wish to override or modify these options, you can use the options
method and pass a list of CometChatActionsIcon
. This list of options will replace the default set.