messageContentTemplateFunction(default: null)

A custom template function for rendering the content area inside message bubbles. This template controls only the text/content portion of messages, not the entire message group structure. When set, it is used for both author and receiver messages unless overridden by authorMessageSettings.messageContentTemplate or receiverMessageSettings.messageContentTemplate.

Example

<div id="chat"></div>
<script>
let messagesData = [
    {
        id: 1,
        text: "This uses a custom content template.",
        authorId: "user1",
        authorName: "John Doe",
        timestamp: new Date(2026, 0, 1, 9, 0)
    },
    {
        id: 2,
        text: "So does this message.",
        authorId: "user2",
        authorName: "Jane Smith",
        timestamp: new Date(2026, 0, 1, 9, 5)
    }
];

$("#chat").kendoChat({
    messageContentTemplate: function(message) {
        return '<div style="border-left:3px solid #1a73e8;padding-left:8px;">' +
               '<em>' + kendo.htmlEncode(message.text) + '</em>' +
               '</div>';
    },
    authorId: "user1",
    dataSource: messagesData
});
</script>
In this article
messageContentTemplate
Not finding the help you need?
Contact Support