CometChatReactions
component is designed to visually represent the reactions received by a message. Each reaction appears in a horizontal alignment beneath the message to indicate which emojis users have used to react.
The number of visible reactions depends on the width of the view. For example, if a message has 5 reactions but the CometChatReactions view can only accommodate 4 reactions within its width, the first three reactions will be displayed visibly. Additionally, an element will be added at the end of the row to indicate the number of other unique reactions that are not immediately visible. This element informs users of the total count of different reactions beyond those initially shown.
CometChatReactions
component is a standard UIView that displays a list of reactions as its children. In the provided UI example, it is utilized within the footer view of the CometChatMessageBubble. However, it is versatile and can be incorporated anywhere a UIView can be placed. The minimum requirement for this component to function is to provide the reactions to display, which can be passed using the baseMessage property.
Swift
onReactionsPressed
event is triggered when a user interacts with a reaction by pressing it, typically to indicate a response or provide feedback.
onReactionsPressed
action.
Reactions
component does not provide any exposed filtering options.
Reactions
component does not provide any available events.
reactionsStyle
to customize the appearance.
Property | Description | Code |
---|---|---|
Background Color | Sets the background color | .set(background: UIColor) |
Corner Radiu | Sets the corner radius | .set(cornerRadius: CometChatCornerStyle) |
Border Width | Sets the width of the border | .set(borderWidth: CGFloat) |
Border Color | Sets the color of the border | .set(borderColor: UIColor) |
Emoji Font | Sets the font for all emojis | .set(emojiFont: UIFont) |
Count Color | Sets the text color for emojis count | .set(countColor: UIColor) |
Count Font | Sets the font for emojis count | .set(countFont: UIFont) |
Active Reaction Font | Sets the font for emojis i.e. reacted by the loggedIn user | .set(activeReactionFont: UIFont) |
Active Reaction TextColor | Sets the text colour for emojis i.e. reacted by the loggedIn user | .set(activeReactionTextColor: UIColor) |
Active Reaction Background Color | Sets the background color for emojis i.e. reacted by the loggedIn user | .set(activeReactionBackgroundColor: UIColor) |
Active Reaction Border Color | Sets the border colour for emojis i.e. reacted by the loggedIn user | .set(activeReactionBorderColor: UIColor) |
Active Reaction Border Width | Sets the border width for emojis i.e. reacted by the loggedIn user | .set(activeReactionBorderWidth: CGFloat) |
Active Reaction Corner Radius | Sets the corner radius for emojis i.e. reacted by the loggedIn user | .set(activeReactionCornerRadius: CometChatCornerStyle) |
Reaction Font | Sets the Font for emojis i.e. not reacted by the loggedIn user | .set(reactionfont: CGFloat) |
Reaction Text Color | Sets the text colour for emojis i.e. not reacted by the loggedIn user | .set(reactionTextColor: UIColor) |
Reaction Background Color | Sets the background colour for emojis i.e. not reacted by the loggedIn user | .set(reactionBackgroundColor: UIColor) |
Reaction Border Color | Sets the border colour for emojis i.e. not reacted by the loggedIn user | .set(reactionBorderColor: UIColor) |
Reaction Corner Radiusr | Sets the text color for the subtitle | .set(reactionCornerRadius: CometChatCornerStyle) |
Reaction Border Width | Sets the border width for emojis i.e. not reacted by the loggedIn user | .set(reactionBorderWidth: CGFloat) |
Property | Description | Code |
---|---|---|
onReactionsLongPressed | This callback is triggered when a user long-presses a reaction. | (( reaction: ReactionCount, baseMessage: BaseMessage?) -> ())? |
onReactionsPressed | This call back get trigger when a add reaction button is clicked. | (( reaction: ReactionCount, baseMessage: BaseMessage?) -> ())? |
configuration | Used to customize configuration for CometChatReactions.. | ReactionsConfiguration |
onReactionsPressed
Component inside Reactions Component, you need use the ReactionsConfiguration
object.
ReactionsConfigurations
.
onReactionsLongPressed
Component inside Reactions Component, you need use the ReactionsConfiguration
object.
ReactionsConfigurations
ReactionsConfigurations
.