Chat

Example

Razor
<kendo-chat>
    <datasource></datasource>
    <file-actions></file-actions>
    <header-items></header-items>
    <message-actions></message-actions>
    <message-toolbar-actions></message-toolbar-actions>
    <messages />
    <suggestions></suggestions>
    <toolbar></toolbar>
    <user />
</kendo-chat>

ChildTags

Attributes

AttributeTypeDescription
nameStringSets the name of the component.
as-moduleBooleanSpecifies whether the initialization script of the component will be rendered as a JavaScript module.
is-in-client-templateBooleanWhen placing a Tag Helper within a Kendo Template, set the type to text/html and add the is-in-client-template="true" attribute.
author-idStringSpecifies the unique identifier of the current user. If not set, a GUID will be generated automatically. This determines which messages are displayed as "own messages" (right-aligned) versus "other messages" (left-aligned).
author-id-fieldStringSpecifies the field name in the data source from which the message author's unique identifier will be read.
author-image-alt-text-fieldStringSpecifies the field name in the data source from which the alt text for the author's avatar image will be read.
author-image-url-fieldStringSpecifies the field name in the data source from which the URL for the author's avatar image will be read.
author-name-fieldStringSpecifies the field name in the data source from which the author's display name will be read.
deferredBooleanSuppress initialization script rendering. Note that this options should be used in conjunction with DeferredScripts method.
allow-message-collapseBooleanEnables or disables message collapsing functionality for expandable messages. When enabled, long messages can be collapsed to save screen space.
auto-bindBooleanControls whether the Chat will automatically fetch data from the data source when initialized. When set to false, you must manually call the data source's fetch() method.
bind-toIEnumerable<ChatMessage>The collection of data items which the data source contains.
datasource-idStringThe data source id
dirTextDirectionSpecifies the text direction of the Chat.
file-attachmentBooleanEnables or disables file attachment functionality in the message input.
files-fieldStringSpecifies the field name in the data source from which the array of files attached to a message will be read.
files-template-handlerStringThe template used to render file attachments in messages. This option expects the name of a JavaScript function that will be called to return the template.
files-template-idStringThe template used to render file attachments in messages. This option expects the ID of the script element that contains the template.
heightStringSets the height of the Chat component.
id-fieldStringSpecifies the field name in the data source from which the unique identifier for each message will be read.
is-deleted-fieldStringSpecifies the field name in the data source that indicates whether a message has been deleted.
is-pinned-fieldStringSpecifies the field name in the data source that indicates whether a message is pinned.
is-typing-fieldStringSpecifies the field name in the data source that indicates whether a message is currently being typed.
message-group-template-handlerStringThe template used to render message groups. This option expects the name of a JavaScript function that will be called to return the template.
message-group-template-idStringThe template used to render message groups. This option expects the ID of the script element that contains the template.
message-reference-template-handlerStringThe template used to render message references (replies and pinned messages). This option expects the name of a JavaScript function that will be called to return the template.
message-reference-template-idStringThe template used to render message references (replies and pinned messages). This option expects the ID of the script element that contains the template.
message-template-handlerStringThe template used to render individual messages. This option expects the name of a JavaScript function that will be called to return the template.
message-template-idStringThe template used to render individual messages. This option expects the ID of the script element that contains the template.
message-time-formatStringThe format string used to display message timestamps.
message-width-modeMessageWidthModeSets the message width mode.
on-context-menu-actionStringThe name of the JavaScript function that will handle the contextMenuAction event. Fired when a message context menu action is executed. This event allows you to handle custom message actions and respond to user interactions with message context menus.
on-downloadStringThe name of the JavaScript function that will handle the download event. Fired when a download action is triggered, either from the "Download All" button or from a file menu download action.
on-file-menu-actionStringThe name of the JavaScript function that will handle the fileMenuAction event. Fired when a file context menu action is executed. This event allows you to handle custom file actions and respond to user interactions with file attachments.
on-inputStringThe name of the JavaScript function that will handle the input event. Fired when the user types in the message input field.
on-send-messageStringThe name of the JavaScript function that will handle the sendMessage event. Fired when a message is about to be sent or when the send process is triggered. This event allows you to modify the message before it's sent or handle stop generation requests.
on-suggestion-clickStringThe name of the JavaScript function that will handle the suggestionClick event. Fired when a user clicks on a suggested message or action. This event is useful for tracking user engagement with suggestions and handling custom suggestion logic.
on-toolbar-actionStringThe name of the JavaScript function that will handle the toolbarAction event. Fired when a toolbar action is executed on a message. This event allows you to handle custom toolbar actions and respond to user interactions with message controls.
on-unpinStringThe name of the JavaScript function that will handle the unpin event. Fired when a pinned message is unpinned. This event is triggered when a user clicks the close (X) button on a pinned message.
reply-to-id-fieldStringSpecifies the field name in the data source that contains the ID of the message being replied to.
script-attributesIDictionary<String,Object>Sets the attributes that will be added to the script tag of the component's initialization script.
skip-sanitizationBooleanControls whether HTML sanitization is skipped when rendering message content. When set to true, the Chat component will not automatically encode HTML entities in message text, allowing for rich HTML content to be displayed. This is useful when integrating with markdown parsers or when you need to display pre-formatted HTML content.Warning: Setting this to true can introduce security vulnerabilities if user input is not properly sanitized elsewhere in your application. Only use this option when you trust the content source or have implemented your own sanitization logic.
speech-to-textBooleanEnables or disables speech-to-text functionality in the message input.
suggested-actions-scrollableBooleanEnables or disables scrollable behavior for suggested actions.
suggested-actions-template-handlerStringThe template used to render suggested actions. This option expects the name of a JavaScript function that will be called to return the template.
suggested-actions-template-idStringThe template used to render suggested actions. This option expects the ID of the script element that contains the template.
suggestions-scrollableBooleanEnables or disables scrollable behavior for message suggestions.
suggestions-template-handlerStringThe template used to render message suggestions. This option expects the name of a JavaScript function that will be called to return the template.
suggestions-template-idStringThe template used to render message suggestions. This option expects the ID of the script element that contains the template.
text-fieldStringSpecifies the field name in the data source from which the message text content will be read.
timestamp-fieldStringSpecifies the field name in the data source from which the message timestamp will be read.
timestamp-template-handlerStringThe template used to render timestamp elements that separate message groups by date. When set to null, the default timestamp logic is used which displays relative dates like "Today", "Yesterday", "Last Wednesday", or absolute dates for older messages.The template function receives an object with date (parsed Date object) and message (current message object) properties and should return the complete HTML structure for the timestamp element.Returning null or an empty string will hide the time breaks from the chat. This option expects the name of a JavaScript function that will be called to return the template.
timestamp-template-idStringThe template used to render timestamp elements that separate message groups by date. When set to null, the default timestamp logic is used which displays relative dates like "Today", "Yesterday", "Last Wednesday", or absolute dates for older messages.The template function receives an object with date (parsed Date object) and message (current message object) properties and should return the complete HTML structure for the timestamp element.Returning null or an empty string will hide the time breaks from the chat. This option expects the ID of the script element that contains the template.
widthStringSets the width of the Chat component.
In this article
ExampleChildTagsAttributes
Not finding the help you need?
Contact Support