Skip to main content

Message

The Message component is a fundamental building block for creating dynamic and interactive chat interfaces. It allows you to effortlessly present messages in a conversational format, making it easy for users to follow and engage in discussions.

Customisations Available

Message component supports below styling customisations as of now. All of the styling customisations are optional as of now, if some styling customisation is not provided, then we pick up the default styling which we have.

Customisable props available along with their types:

ParameterTypeOptionalCustomizable Properties for objects
borderRadiusnumber✔️
sentMessageBackgroundColorstring✔️
receivedMessageBackgroundColorstring✔️
selectedBackgroundColorstring✔️
selectedMessageBackgroundColorstring✔️
textStylesobject✔️• fontSize: number
• fontStyle: string
• fontFamily: string
linkTextColorstring✔️
taggingTextColorstring✔️
selectedMessagesBackgroundColorstring✔️
stateMessagesTextStylesobject✔️• fontSize: number
• fontStyle: string
• fontFamily: string
• color: string
messageReceivedHeaderobject✔️• senderNameStyles: object
• fontSize: number
• fontFamily: string
• color: string
• senderDesignationStyles: object
• fontSize: number
• fontFamily: string
• color: string
dateStateMessageobject✔️• fontSize: number
• fontFamily: string
• color: string
• backgroundColor: string
playPauseBoxIconobject✔️• backgroundColor: string
voiceNoteSliderobject✔️• minimumTrackTintColor: string
• thumbTintColor: string
pollVoteSliderColorobject✔️• backgroundColor: string

Code snippet

import { STYLES } from "@likeminds.community/chat-rn-core";

// styling for messageBubble
const messageBubbleStyles = {
textStyles: {
fontSize: 15,
},
linkTextColor: "#3CA874",
taggingTextColor: "#3CA874",
selectedMessagesBackgroundColor: "#3CA87429",
stateMessagesTextStyles: {
color: "#808080",
backgroundColor: "#C7E3D6",
},
dateStateMessage: {
color: "#808080",
},
messageReceivedHeader: {
senderNameStyles: {
color: "#3CA874",
fontSize: 15,
},
senderDesignationStyles: {
fontSize: 14,
},
},
playPauseBoxIcon: {
backgroundColor: "#B7D340",
},
voiceNoteSlider: {
minimumTrackTintColor: "#B7D340",
thumbTintColor: "#B7D340",
},
pollVoteSliderColor: {
backgroundColor: "#3CA87429",
},
sentMessageBackgroundColor: "#C7E3D6",
};

if (messageBubbleStyles) {
STYLES.setChatBubbleStyle(messageBubbleStyles);
}

return <LMOverlayProvider
lmChatClient={lmChatClient}
userName={userName}
userUniqueId={userUniqueId}
profileImageUrl={profileImageUrl}
lmChatInterface={lmChatInterface}
>
{/* Add navigation container */}
</LMOverlayProvider>;