Skip to main content
Version: v4

Card Bubble

The CometChatCardBubble component is used to display a card within a chat bubble. The card includes an image, text, and action buttons. It helps to offer action-oriented chat experiences, like booking a flight, ordering food, scheduling a meeting, etc., directly in the chat.

Methods

MethodsParametersDescription
setCardMessageCardMessageAn instance of the CardMessage class which holds information about the card such as image URL, text, and action buttons.
setStyleCardBubbleStyleAn instance of the CardBubbleStyle class for customizing the appearance of the card bubble.

CardBubbleStyle

CardBubbleStyle is a class containing attributes to customize the appearance of the card in the CometChatCardBubble component.

MethodsTypeDescription
setBackgroundUIColorUsed to set the background color of the card bubble.
setCornerRadiusCGFloatUsed to set the corner radius of the card bubble.
setBorderWidthIntUsed to set the Border width
setBorderColorUIColorUsed to set the Border color
setTextColorUIColorUsed to set the color of the title.
setButtonBackgroundColorUIColorUsed to customize the style of buttons.
setButtonTextColorUIColorUsed to set Button text color.
setContentBackgroundColorUIColorUsed to set Content background color
setButtonSeparatorColorUIColorUsed to set Button separator color
setProgressBarTintColorUIColorUsed to set the color of the image in the card.
setQuickViewStyleQuickViewStyleUsed to set the QuickView style
setImageBubbleStyleImageBubbleStyleUsed to set how to resize the image in the card.

Usage

let cardBubble = CometChatCardBubble()
if let controller = controller {
cardBubble.set(controller: controller)
}
if let message = message {
cardBubble.set(cardMessage: message)
}