New to Telerik UI for ASP.NET Core? Start a free 30-day trial

Defines the fluent API for configuring the Kendo UI Chat

Definition

Constructors

Initializes a new instance of the ChatBuilder class.

C#
public ChatBuilder(Chat component)
Parameters:componentChat

Methods

Configures the action button (send/stop button) in the message input area. Allows customization of icons, text labels, and loading state appearance.

C#
public ChatBuilder ActionButton(Action<ChatActionButtonSettingsBuilder> configurator)
Parameters:configuratorAction<ChatActionButtonSettingsBuilder>

The ChatActionButtonSettingsBuilder for the actionbutton setting.

Returns:

ChatBuilder

Returns the current instance of ChatBuilder .

Enables or disables message collapsing functionality for expandable messages. When enabled, long messages can be collapsed to save screen space.

C#
public ChatBuilder AllowMessageCollapse()
Returns:

ChatBuilder

Returns the current ChatBuilder instance.

Enables or disables message collapsing functionality for expandable messages. When enabled, long messages can be collapsed to save screen space.

C#
public ChatBuilder AllowMessageCollapse(bool value)
Parameters:valuebool

The value for AllowMessageCollapse

Returns:

ChatBuilder

Returns the current ChatBuilder instance.

Sets the default layout mode for rich attachments.

C#
public ChatBuilder AttachmentLayout(ChatAttachmentLayout value)
Parameters:valueChatAttachmentLayout

The value for AttachmentLayout

Returns:

ChatBuilder

Returns the current ChatBuilder instance.

The field of the message data item that provides the attachment layout mode for that specific message. Allows per-message override of the global attachmentLayout setting.

C#
public ChatBuilder AttachmentLayoutField(string value)
Parameters:valuestring

The value for AttachmentLayoutField

Returns:

ChatBuilder

Returns the current ChatBuilder instance.

The field of the message data item that provides the rich attachments array. Each attachment object can contain contentType, title, subtitle, thumbnailUrl, and actions properties.

C#
public ChatBuilder AttachmentsField(string value)
Parameters:valuestring

The value for AttachmentsField

Returns:

ChatBuilder

Returns the current ChatBuilder instance.

The template used to render individual attachments within messages. Receives the attachment data object and should return an HTML string. When not set, the default attachment rendering is used.The function receives the attachment object with properties such as title, subtitle, image, contentType, and content.

C#
public ChatBuilder AttachmentTemplate<TModel>(TemplateBuilder<TModel> template)
Parameters:templateTemplateBuilder<TModel>

A Template component that configures the attachmenttemplate.

Returns:

ChatBuilder

Returns the current ChatBuilder instance.

The template used to render individual attachments within messages. Receives the attachment data object and should return an HTML string. When not set, the default attachment rendering is used.The function receives the attachment object with properties such as title, subtitle, image, contentType, and content.

C#
public ChatBuilder AttachmentTemplateHandler(string templateHandler)
Parameters:templateHandlerstring

The handler that returs the template for AttachmentTemplate

Returns:

ChatBuilder

Returns the current ChatBuilder instance.

Specifies 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).

C#
public ChatBuilder AuthorId(string value)
Parameters:valuestring

The value for AuthorId

Returns:

ChatBuilder

Returns the current ChatBuilder instance.

Specifies the field name in the data source from which the message author's unique identifier will be read.

C#
public ChatBuilder AuthorIdField(string value)
Parameters:valuestring

The value for AuthorIdField

Returns:

ChatBuilder

Returns the current ChatBuilder instance.

Specifies the field name in the data source from which the alt text for the author's avatar image will be read.

C#
public ChatBuilder AuthorImageAltTextField(string value)
Parameters:valuestring

The value for AuthorImageAltTextField

Returns:

ChatBuilder

Returns the current ChatBuilder instance.

Specifies the field name in the data source from which the URL for the author's avatar image will be read.

C#
public ChatBuilder AuthorImageUrlField(string value)
Parameters:valuestring

The value for AuthorImageUrlField

Returns:

ChatBuilder

Returns the current ChatBuilder instance.

User-specific message settings applied to messages sent by the current user (author). These settings override the global display options like showAvatar, showUsername, and messageWidthMode for author messages only. See also receiverMessageSettings.The object accepts the following properties: showAvatar - Boolean - Whether to show the avatar for author messages.; showUsername - Boolean - Whether to show the username for author messages.; messageWidthMode - String - Message width mode: "standard" or "full".; allowMessageCollapse - Boolean - Whether author messages can be collapsed.; messageTemplate - Function - Template override for author messages. Receives the same arguments as messageTemplate.; messageContentTemplate - Function - Content template override for author messages. Receives the current message object.; enableFileActions - Boolean - Whether file actions are enabled for author messages.; enableContextMenuActions - Boolean - Whether context menu actions are enabled for author messages.; messageToolbarActions - Array - Toolbar actions specific to author messages. or messageActions - Array - Context menu actions specific to author messages..

C#
public ChatBuilder AuthorMessageSettings(Action<ChatMessageSettingsBuilder> configurator)
Parameters:configuratorAction<ChatMessageSettingsBuilder>

The ChatMessageSettingsBuilder for the authormessagesettings setting.

Returns:

ChatBuilder

Returns the current instance of ChatBuilder .

Specifies the field name in the data source from which the author's display name will be read.

C#
public ChatBuilder AuthorNameField(string value)
Parameters:valuestring

The value for AuthorNameField

Returns:

ChatBuilder

Returns the current ChatBuilder instance.

Enables or disables automatic assignment of a unique ID to each message posted in the chat. When enabled, messages without an explicit ID will be assigned a generated unique identifier.This option should be set to false if the chat is configured to work with a remote data source and the messages are created on the server. In that case, the id should be assigned on the server itself.

C#
public ChatBuilder AutoAssignId(bool value)
Parameters:valuebool

The value for AutoAssignId

Returns:

ChatBuilder

Returns the current ChatBuilder instance.

Controls whether the Chat will automatically fetch data from the data source when initialized.When scrollMode is set to "endless" and the dataSource uses serverPaging, autoBind: false is not supported. Remote endless mode always starts with a Chat-managed latest-window request, and manual dataSource.read() and dataSource.fetch() calls are not supported for that mode.

C#
public ChatBuilder AutoBind(bool value)
Parameters:valuebool

The value for AutoBind

Returns:

ChatBuilder

Returns the current ChatBuilder instance.

Defines the amount of space that is preserved above a newly auto-scrolled incoming message when the user is already near the bottom of the message list. Accepts either a pixel value or a percentage of the visible message list area.

C#
public ChatBuilder AutoScrollThreshold(double value)
Parameters:valuedouble

The value for AutoScrollThreshold

Returns:

ChatBuilder

Returns the current ChatBuilder instance.

Binds the component to an IEnumerable collection.

C#
public ChatBuilder BindTo(IEnumerable<ChatMessage> data)
Parameters:dataIEnumerable<ChatMessage>

The IEnumerable collection.

Returns:

ChatBuilder

Returns the current ChatBuilder instance.

Example:
C#
@(Html.Kendo().Chat()
.Name("chat")
.BindTo(new List&lt;ChatMessage&gt;
{
new ChatMessage { Text = "Text1" },
new ChatMessage { Text = "Text2" }
}))

Sets the DataSource configuration of the Chat for remote data binding.

C#
public ChatBuilder DataSource(Action<DataSourceBuilder<object>> configurator)
Parameters:configuratorAction<DataSourceBuilder<object>>

The action that configures the DataSource.

Returns:

ChatBuilder

Returns the current ChatBuilder instance.

Example:
C#
@(Html.Kendo().Chat()
.Name("chat")
.DataSource(source =&gt;
{
source.Read(read =&gt;
{
read.Action("GetChatMessages", "Home");
})
})
)

Sets the DataSource configuration of the Chat for remote data binding.

C#
public ChatBuilder DataSource(string dataSourceId)
Parameters:dataSourceIdstring

The dataSource id that configures the DataSource.

Returns:

ChatBuilder

Returns the current ChatBuilder instance.

Example:
C#
@(Html.Kendo().Chat()
.Name("chat")
.DataSource("myDataSource")
)

Specifies the text direction of the Chat.

C#
public ChatBuilder Dir(TextDirection value)
Parameters:valueTextDirection

The value for Dir

Returns:

ChatBuilder

Returns the current ChatBuilder instance.

Specifies the delay in milliseconds before the Chat loads older or newer messages after the user reaches an endless-scroll edge. The delay applies only to endless edge-trigger loading and does not affect the scroll-to-bottom button behavior or separator updates.

C#
public ChatBuilder EndlessScrollDebounceDelay(double value)
Parameters:valuedouble

The value for EndlessScrollDebounceDelay

Returns:

ChatBuilder

Returns the current ChatBuilder instance.

Configures the client-side events.

C#
public ChatBuilder Events(Action<ChatEventBuilder> configurator)
Parameters:configuratorAction<ChatEventBuilder>

The client events action.

Returns:

ChatBuilder

Returns the current ChatBuilder instance.

Example:
C#
@(Html.Kendo().Chat()
.Name("Chat")
.Events(events =&gt; events
.ExecuteAction("onExecuteAction")
)
)

The field of the message data item that provides the failed flag. When true, the message is rendered with a failed state indicator and a retry button.

C#
public ChatBuilder FailedField(string value)
Parameters:valuestring

The value for FailedField

Returns:

ChatBuilder

Returns the current ChatBuilder instance.

Defines the collection of actions that will be rendered in the context menu for file attachments. Each action represents an operation that users can perform on files (download, delete, preview, etc.).

C#
public ChatBuilder FileActions(Action<ChatFileActionFactory> configurator)
Parameters:configuratorAction<ChatFileActionFactory>

The ChatFileActionFactory for the fileactions setting.

Returns:

ChatBuilder

Returns the current instance of ChatBuilder .

Configures the file select button (attachment button) in the message input area. Can be set to: true: Shows the button with default settings; false: Hides the button completely (does not render) or Object: Shows the button with custom configuration.

C#
public ChatBuilder FileAttachment(Action<ChatFileAttachmentSettingsBuilder> configurator)
Parameters:configuratorAction<ChatFileAttachmentSettingsBuilder>

The ChatFileAttachmentSettingsBuilder for the fileattachment setting.

Returns:

ChatBuilder

Returns the current instance of ChatBuilder .

Configures the file select button (attachment button) in the message input area. Can be set to: true: Shows the button with default settings; false: Hides the button completely (does not render) or Object: Shows the button with custom configuration.

C#
public ChatBuilder FileAttachment(bool enabled)
Parameters:enabledbool

Enables or disables the fileattachment option.

Returns:

ChatBuilder

Returns the current instance of ChatFileAttachmentSettingsBuilder .

Specifies the field name in the data source from which the array of files attached to a message will be read.

C#
public ChatBuilder FilesField(string value)
Parameters:valuestring

The value for FilesField

Returns:

ChatBuilder

Returns the current ChatBuilder instance.

Controls the layout mode for file attachments within messages.

C#
public ChatBuilder FilesLayoutMode(ChatFilesLayout value)
Parameters:valueChatFilesLayout

The value for FilesLayoutMode

Returns:

ChatBuilder

Returns the current ChatBuilder instance.

The template used to render file attachments in messages.

C#
public ChatBuilder FilesTemplate<TModel>(TemplateBuilder<TModel> template)
Parameters:templateTemplateBuilder<TModel>

A Template component that configures the filestemplate.

Returns:

ChatBuilder

Returns the current ChatBuilder instance.

The template used to render file attachments in messages.

C#
public ChatBuilder FilesTemplateHandler(string templateHandler)
Parameters:templateHandlerstring

The handler that returs the template for FilesTemplate

Returns:

ChatBuilder

Returns the current ChatBuilder instance.

The template used to render file attachments in messages.

C#
[Obsolete("FilesTemplateId is obsolete. Please use FilesTemplateHandler or FilesTemplate instead.")]
public ChatBuilder FilesTemplateId(string templateId)
Parameters:templateIdstring

The ID of the template element for FilesTemplate

Returns:

ChatBuilder

Returns the current ChatBuilder instance.

Defines the collection of items that will be rendered in the Chat header. Each item represents a component or content that appears in the header area above the message list. The items follow the same structure as AppBar items.

C#
public ChatBuilder HeaderItems(Action<AppBarItemFactory> configurator)
Parameters:configuratorAction<AppBarItemFactory>

The AppBarItemFactory for the header items setting.

Returns:

ChatBuilder

Returns the current instance of ChatBuilder .

A custom template function for rendering the chat header. When set, this overrides the headerItems configuration and provides full control over the header content. The function should return an HTML string.

C#
public ChatBuilder HeaderTemplate<TModel>(TemplateBuilder<TModel> template)
Parameters:templateTemplateBuilder<TModel>

A Template component that configures the headertemplate.

Returns:

ChatBuilder

Returns the current ChatBuilder instance.

A custom template function for rendering the chat header. When set, this overrides the headerItems configuration and provides full control over the header content. The function should return an HTML string.

C#
public ChatBuilder HeaderTemplateHandler(string templateHandler)
Parameters:templateHandlerstring

The handler that returs the template for HeaderTemplate

Returns:

ChatBuilder

Returns the current ChatBuilder instance.

Sets the height of the Chat component.

C#
public ChatBuilder Height(string value)
Parameters:valuestring

The value for Height

Returns:

ChatBuilder

Returns the current ChatBuilder instance.

Specifies the field name in the data source from which the unique identifier for each message will be read.

C#
public ChatBuilder IdField(string value)
Parameters:valuestring

The value for IdField

Returns:

ChatBuilder

Returns the current ChatBuilder instance.

Specifies the field name in the data source that indicates whether a message has been deleted.

C#
public ChatBuilder IsDeletedField(string value)
Parameters:valuestring

The value for IsDeletedField

Returns:

ChatBuilder

Returns the current ChatBuilder instance.

Specifies the field name in the data source that indicates whether a message is pinned.

C#
public ChatBuilder IsPinnedField(string value)
Parameters:valuestring

The value for IsPinnedField

Returns:

ChatBuilder

Returns the current ChatBuilder instance.

Specifies the field name in the data source that indicates whether a message is currently being typed.

C#
public ChatBuilder IsTypingField(string value)
Parameters:valuestring

The value for IsTypingField

Returns:

ChatBuilder

Returns the current ChatBuilder instance.

Sets the initial loading state of the Chat component. When true, the send button displays a loading/stop indicator instead of the send icon. This is useful for AI chat applications where generating responses takes time. See also the loading method for toggling this state at runtime.

C#
public ChatBuilder Loading()
Returns:

ChatBuilder

Returns the current ChatBuilder instance.

Sets the initial loading state of the Chat component. When true, the send button displays a loading/stop indicator instead of the send icon. This is useful for AI chat applications where generating responses takes time. See also the loading method for toggling this state at runtime.

C#
public ChatBuilder Loading(bool value)
Parameters:valuebool

The value for Loading

Returns:

ChatBuilder

Returns the current ChatBuilder instance.

Defines the collection of actions that will be rendered in the context menu for messages. By default, the Chat includes four actions: Reply, Copy, and Pin. You can customize this list by providing your own actions or combining default actions with custom ones.Default actions: { name: "reply", text: "Reply", icon: "undo" }; { name: "copy", text: "Copy", icon: "copy" }; { name: "pin", text: "Pin", icon: "pin" } or { name: "delete", text: "Delete", icon: "trash" }.

C#
public ChatBuilder MessageActions(Action<ChatMessageActionFactory> configurator)
Parameters:configuratorAction<ChatMessageActionFactory>

The ChatMessageActionFactory for the messageactions setting.

Returns:

ChatBuilder

Returns the current instance of ChatBuilder .

Configures the built-in message input box (PromptBox). Use this option to customize the default input mode, row count, and auto-grow height when messageBoxTemplate is not set.

C#
public ChatBuilder MessageBox(Action<ChatMessageBoxSettingsBuilder> configurator)
Parameters:configuratorAction<ChatMessageBoxSettingsBuilder>

The ChatMessageBoxSettingsBuilder for the messagebox setting.

Returns:

ChatBuilder

Returns the current instance of ChatBuilder .

The template used to render the message input area at the bottom of the Chat. The function receives no arguments and should return an HTML string for the custom message box markup.When using a custom template, the first textarea or supported text input inside the template is used as the message input. To enable send button behavior, add an element with the ref-chat-message-box-send-button attribute. If the template contains input[type='file'] elements, they participate in the file selection flow.

C#
public ChatBuilder MessageBoxTemplate<TModel>(TemplateBuilder<TModel> template)
Parameters:templateTemplateBuilder<TModel>

A Template component that configures the messageboxtemplate.

Returns:

ChatBuilder

Returns the current ChatBuilder instance.

The template used to render the message input area at the bottom of the Chat. The function receives no arguments and should return an HTML string for the custom message box markup.When using a custom template, the first textarea or supported text input inside the template is used as the message input. To enable send button behavior, add an element with the ref-chat-message-box-send-button attribute. If the template contains input[type='file'] elements, they participate in the file selection flow.

C#
public ChatBuilder MessageBoxTemplateHandler(string templateHandler)
Parameters:templateHandlerstring

The handler that returs the template for MessageBoxTemplate

Returns:

ChatBuilder

Returns the current ChatBuilder instance.

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.

C#
public ChatBuilder MessageContentTemplate<TModel>(TemplateBuilder<TModel> template)
Parameters:templateTemplateBuilder<TModel>

A Template component that configures the messagecontenttemplate.

Returns:

ChatBuilder

Returns the current ChatBuilder instance.

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.

C#
public ChatBuilder MessageContentTemplateHandler(string templateHandler)
Parameters:templateHandlerstring

The handler that returs the template for MessageContentTemplate

Returns:

ChatBuilder

Returns the current ChatBuilder instance.

The template used to render message groups.

C#
public ChatBuilder MessageGroupTemplate<TModel>(TemplateBuilder<TModel> template)
Parameters:templateTemplateBuilder<TModel>

A Template component that configures the messagegrouptemplate.

Returns:

ChatBuilder

Returns the current ChatBuilder instance.

The template used to render message groups.

C#
public ChatBuilder MessageGroupTemplateHandler(string templateHandler)
Parameters:templateHandlerstring

The handler that returs the template for MessageGroupTemplate

Returns:

ChatBuilder

Returns the current ChatBuilder instance.

The template used to render message groups.

C#
[Obsolete("MessageGroupTemplateId is obsolete. Please use MessageGroupTemplateHandler or MessageGroupTemplate instead.")]
public ChatBuilder MessageGroupTemplateId(string templateId)
Parameters:templateIdstring

The ID of the template element for MessageGroupTemplate

Returns:

ChatBuilder

Returns the current ChatBuilder instance.

The template used to render message references (replies and pinned messages).

C#
public ChatBuilder MessageReferenceTemplate<TModel>(TemplateBuilder<TModel> template)
Parameters:templateTemplateBuilder<TModel>

A Template component that configures the messagereferencetemplate.

Returns:

ChatBuilder

Returns the current ChatBuilder instance.

The template used to render message references (replies and pinned messages).

C#
public ChatBuilder MessageReferenceTemplateHandler(string templateHandler)
Parameters:templateHandlerstring

The handler that returs the template for MessageReferenceTemplate

Returns:

ChatBuilder

Returns the current ChatBuilder instance.

The template used to render message references (replies and pinned messages).

C#
[Obsolete("MessageReferenceTemplateId is obsolete. Please use MessageReferenceTemplateHandler or MessageReferenceTemplate instead.")]
public ChatBuilder MessageReferenceTemplateId(string templateId)
Parameters:templateIdstring

The ID of the template element for MessageReferenceTemplate

Returns:

ChatBuilder

Returns the current ChatBuilder instance.

Allows localization of the strings that are used in the component.

C#
public ChatBuilder Messages(Action<ChatMessagesSettingsBuilder> configurator)
Parameters:configuratorAction<ChatMessagesSettingsBuilder>

The ChatMessagesSettingsBuilder for the messages setting.

Returns:

ChatBuilder

Returns the current instance of ChatBuilder .

Custom settings for message status display, allowing you to configure icons, text, and CSS classes for each message delivery status. The object should be a mapping from status values ("sent", "delivered", "seen", "failed") to settings objects.Each status settings object accepts: icon - String - Font icon name to display.; text - String - Text label for the status. or cssClass - String - Additional CSS class to apply to the status element..

C#
public ChatBuilder MessageStatusSettings(Action<ChatMessageStatusSettingsSettingsBuilder> configurator)
Parameters:configuratorAction<ChatMessageStatusSettingsSettingsBuilder>

The ChatMessageStatusSettingsSettingsBuilder for the messagestatussettings setting.

Returns:

ChatBuilder

Returns the current instance of ChatBuilder .

A custom template function for rendering message status indicators. Receives a context object with status (the status string) and message (the message object). When set, this overrides the default status rendering and messageStatusSettings.

C#
public ChatBuilder MessageStatusTemplate<TModel>(TemplateBuilder<TModel> template)
Parameters:templateTemplateBuilder<TModel>

A Template component that configures the messagestatustemplate.

Returns:

ChatBuilder

Returns the current ChatBuilder instance.

A custom template function for rendering message status indicators. Receives a context object with status (the status string) and message (the message object). When set, this overrides the default status rendering and messageStatusSettings.

C#
public ChatBuilder MessageStatusTemplateHandler(string templateHandler)
Parameters:templateHandlerstring

The handler that returs the template for MessageStatusTemplate

Returns:

ChatBuilder

Returns the current ChatBuilder instance.

The template used to render individual messages.

C#
public ChatBuilder MessageTemplate<TModel>(TemplateBuilder<TModel> template)
Parameters:templateTemplateBuilder<TModel>

A Template component that configures the messagetemplate.

Returns:

ChatBuilder

Returns the current ChatBuilder instance.

The template used to render individual messages.

C#
public ChatBuilder MessageTemplateHandler(string templateHandler)
Parameters:templateHandlerstring

The handler that returs the template for MessageTemplate

Returns:

ChatBuilder

Returns the current ChatBuilder instance.

The template used to render individual messages.

C#
[Obsolete("MessageTemplateId is obsolete. Please use MessageTemplateHandler or MessageTemplate instead.")]
public ChatBuilder MessageTemplateId(string templateId)
Parameters:templateIdstring

The ID of the template element for MessageTemplate

Returns:

ChatBuilder

Returns the current ChatBuilder instance.

The format string used to display message timestamps.

C#
public ChatBuilder MessageTimeFormat(string value)
Parameters:valuestring

The value for MessageTimeFormat

Returns:

ChatBuilder

Returns the current ChatBuilder instance.

Defines the collection of actions that will be rendered in the message toolbar.

C#
public ChatBuilder MessageToolbarActions(Action<ChatMessageToolbarActionFactory> configurator)
Parameters:configuratorAction<ChatMessageToolbarActionFactory>

The ChatMessageToolbarActionFactory for the messagetoolbaractions setting.

Returns:

ChatBuilder

Returns the current instance of ChatBuilder .

Sets the messages width mode.

C#
public ChatBuilder MessageWidthMode(ChatMessageWidth mode)
Parameters:modeChatMessageWidthReturns:

ChatBuilder

Returns the current ChatBuilder instance.

A custom template function for rendering an empty state when the chat has no messages. When set, the template output is displayed in place of the empty message list area, providing a visual cue that the conversation has not started yet.

C#
public ChatBuilder NoDataTemplate<TModel>(TemplateBuilder<TModel> template)
Parameters:templateTemplateBuilder<TModel>

A Template component that configures the nodatatemplate.

Returns:

ChatBuilder

Returns the current ChatBuilder instance.

A custom template function for rendering an empty state when the chat has no messages. When set, the template output is displayed in place of the empty message list area, providing a visual cue that the conversation has not started yet.

C#
public ChatBuilder NoDataTemplateHandler(string templateHandler)
Parameters:templateHandlerstring

The handler that returs the template for NoDataTemplate

Returns:

ChatBuilder

Returns the current ChatBuilder instance.

Documents the default endless batch size.When scrollMode is set to "endless", the effective batch size comes from dataSource.pageSize() for the initial latest window, older/newer adjacent loads, and jump requests. Configure the bound DataSource page size for endless mode instead of relying on a separate Chat range contract, because a root Chat pageSize value does not override the bound DataSource page size.If the bound DataSource does not declare a valid page size, the Chat seeds the DataSource with the default endless batch size of 20 before the first endless load.

C#
public ChatBuilder PageSize(double value)
Parameters:valuedouble

The value for PageSize

Returns:

ChatBuilder

Returns the current ChatBuilder instance.

Provides a stable root-level collection that the Chat can use for pinned-message banners when the current endless-scroll window does not contain the pinned target.This option is most useful with scrollMode set to "endless" and a server-paged dataSource.The Chat uses the last item in the pinnedMessages array as the active pinned banner. Each item can be a full message object or a partial object, but it must contain enough data to identify the target and render the pinned banner.If the pinned target is not part of the current remote window, the Chat can still render the banner from pinnedMessages while using the endless endpoint to load the target batch when the banner is clicked.

C#
public ChatBuilder PinnedMessages(Action<ChatPinnedMessageFactory> configurator)
Parameters:configuratorAction<ChatPinnedMessageFactory>

The ChatPinnedMessageFactory for the pinnedmessages setting.

Returns:

ChatBuilder

Returns the current instance of ChatBuilder .

User-specific message settings applied to messages received from other users. These settings override the global display options like showAvatar, showUsername, and messageWidthMode for receiver messages only. See also authorMessageSettings.The object accepts the following properties: showAvatar - Boolean - Whether to show the avatar for receiver messages.; showUsername - Boolean - Whether to show the username for receiver messages.; messageWidthMode - String - Message width mode: "standard" or "full".; allowMessageCollapse - Boolean - Whether receiver messages can be collapsed.; messageTemplate - Function - Template override for receiver messages. Receives the same arguments as messageTemplate.; messageContentTemplate - Function - Content template override for receiver messages. Receives the current message object.; enableFileActions - Boolean - Whether file actions are enabled for receiver messages.; enableContextMenuActions - Boolean - Whether context menu actions are enabled for receiver messages.; messageToolbarActions - Array - Toolbar actions specific to receiver messages. or messageActions - Array - Context menu actions specific to receiver messages..

C#
public ChatBuilder ReceiverMessageSettings(Action<ChatMessageSettingsBuilder> configurator)
Parameters:configuratorAction<ChatMessageSettingsBuilder>

The ChatMessageSettingsBuilder for the receivermessagesettings setting.

Returns:

ChatBuilder

Returns the current instance of ChatBuilder .

Specifies the field name in the data source that contains the ID of the message being replied to.

C#
public ChatBuilder ReplyToIdField(string value)
Parameters:valuestring

The value for ReplyToIdField

Returns:

ChatBuilder

Returns the current ChatBuilder instance.

The scroll mode for the scrollable behavior.

C#
public ChatBuilder ScrollMode(ChatScrollMode value)
Parameters:valueChatScrollMode

The value for ScrollMode

Returns:

ChatBuilder

Returns the current ChatBuilder instance.

Shows or hides the floating scroll-to-bottom button that appears when the user moves away from the latest messages. In endless scrolling mode, the button is also used to return to the latest rendered batch before scrolling to its bottom.

C#
public ChatBuilder ScrollToBottomButton(bool value)
Parameters:valuebool

The value for ScrollToBottomButton

Returns:

ChatBuilder

Returns the current ChatBuilder instance.

Controls whether avatars are displayed next to messages. This is a global setting that can be overridden per-user via authorMessageSettings and receiverMessageSettings.

C#
public ChatBuilder ShowAvatar(bool value)
Parameters:valuebool

The value for ShowAvatar

Returns:

ChatBuilder

Returns the current ChatBuilder instance.

Controls whether usernames are displayed above messages. This is a global setting that can be overridden per-user via authorMessageSettings and receiverMessageSettings.

C#
public ChatBuilder ShowUsername(bool value)
Parameters:valuebool

The value for ShowUsername

Returns:

ChatBuilder

Returns the current ChatBuilder instance.

Controls 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.

C#
public ChatBuilder SkipSanitization()
Returns:

ChatBuilder

Returns the current ChatBuilder instance.

Controls 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.

C#
public ChatBuilder SkipSanitization(bool value)
Parameters:valuebool

The value for SkipSanitization

Returns:

ChatBuilder

Returns the current ChatBuilder instance.

Configures speech-to-text functionality in the message input. The button is always visible. When null or not configured, the button is enabled by default. Use { enable: false } to disable it.

C#
public ChatBuilder SpeechToText(Action<ChatSpeechToTextSettingsBuilder> configurator)
Parameters:configuratorAction<ChatSpeechToTextSettingsBuilder>

The ChatSpeechToTextSettingsBuilder for the speechtotext setting.

Returns:

ChatBuilder

Returns the current instance of ChatBuilder .

Configures speech-to-text functionality in the message input. The button is always visible. When null or not configured, the button is enabled by default. Use { enable: false } to disable it.

C#
public ChatBuilder SpeechToText(bool enabled)
Parameters:enabledbool

Enables or disables the speechtotext option.

Returns:

ChatBuilder

Returns the current instance of ChatSpeechToTextSettingsBuilder .

Specifies the field name in the data source from which the message status will be read. The status describes the delivery state of the message (e.g. "Sending", "Sent", "Delivered", "Seen", "Failed"). See also messageStatusSettings.

C#
public ChatBuilder StatusField(string value)
Parameters:valuestring

The value for StatusField

Returns:

ChatBuilder

Returns the current ChatBuilder instance.

Layout mode for suggested actions.

C#
public ChatBuilder SuggestedActionsLayoutMode(SuggestionsLayoutMode value)
Parameters:valueSuggestionsLayoutMode

The value for SuggestedActionsLayoutMode

Returns:

ChatBuilder

Returns the current ChatBuilder instance.

Deprecated: Use suggestedActionsLayoutMode instead.Enables or disables scrollable behavior for suggested actions.

C#
public ChatBuilder SuggestedActionsScrollable()
Returns:

ChatBuilder

Returns the current ChatBuilder instance.

Deprecated: Use suggestedActionsLayoutMode instead.Enables or disables scrollable behavior for suggested actions.

C#
public ChatBuilder SuggestedActionsScrollable(bool value)
Parameters:valuebool

The value for SuggestedActionsScrollable

Returns:

ChatBuilder

Returns the current ChatBuilder instance.

The template used to render suggested actions.

C#
public ChatBuilder SuggestedActionsTemplate<TModel>(TemplateBuilder<TModel> template)
Parameters:templateTemplateBuilder<TModel>

A Template component that configures the suggestedactionstemplate.

Returns:

ChatBuilder

Returns the current ChatBuilder instance.

The template used to render suggested actions.

C#
public ChatBuilder SuggestedActionsTemplateHandler(string templateHandler)
Parameters:templateHandlerstring

The handler that returs the template for SuggestedActionsTemplate

Returns:

ChatBuilder

Returns the current ChatBuilder instance.

The template used to render suggested actions.

C#
[Obsolete("SuggestedActionsTemplateId is obsolete. Please use SuggestedActionsTemplateHandler or SuggestedActionsTemplate instead.")]
public ChatBuilder SuggestedActionsTemplateId(string templateId)
Parameters:templateIdstring

The ID of the template element for SuggestedActionsTemplate

Returns:

ChatBuilder

Returns the current ChatBuilder instance.

Defines the collection of suggested messages that users can quickly select. These appear as clickable buttons below the message input area, allowing users to send common responses quickly.

C#
public ChatBuilder Suggestions(Action<ChatSuggestionFactory> configurator)
Parameters:configuratorAction<ChatSuggestionFactory>

The ChatSuggestionFactory for the suggestions setting.

Returns:

ChatBuilder

Returns the current instance of ChatBuilder .

Controls what happens when a user selects a suggestion.

C#
public ChatBuilder SuggestionsBehavior(ChatSuggestionsBehavior value)
Parameters:valueChatSuggestionsBehavior

The value for SuggestionsBehavior

Returns:

ChatBuilder

Returns the current ChatBuilder instance.

The layout mode for the message box suggestions.

C#
public ChatBuilder SuggestionsLayoutMode(SuggestionsLayoutMode value)
Parameters:valueSuggestionsLayoutMode

The value for SuggestionsLayoutMode

Returns:

ChatBuilder

Returns the current ChatBuilder instance.

Deprecated: Use suggestionsLayoutMode instead.Enables or disables scrollable behavior for message suggestions.

C#
public ChatBuilder SuggestionsScrollable()
Returns:

ChatBuilder

Returns the current ChatBuilder instance.

Deprecated: Use suggestionsLayoutMode instead.Enables or disables scrollable behavior for message suggestions.

C#
public ChatBuilder SuggestionsScrollable(bool value)
Parameters:valuebool

The value for SuggestionsScrollable

Returns:

ChatBuilder

Returns the current ChatBuilder instance.

The template used to render message suggestions.

C#
public ChatBuilder SuggestionsTemplate<TModel>(TemplateBuilder<TModel> template)
Parameters:templateTemplateBuilder<TModel>

A Template component that configures the suggestionstemplate.

Returns:

ChatBuilder

Returns the current ChatBuilder instance.

The template used to render message suggestions.

C#
public ChatBuilder SuggestionsTemplateHandler(string templateHandler)
Parameters:templateHandlerstring

The handler that returs the template for SuggestionsTemplate

Returns:

ChatBuilder

Returns the current ChatBuilder instance.

The template used to render message suggestions.

C#
[Obsolete("SuggestionsTemplateId is obsolete. Please use SuggestionsTemplateHandler or SuggestionsTemplate instead.")]
public ChatBuilder SuggestionsTemplateId(string templateId)
Parameters:templateIdstring

The ID of the template element for SuggestionsTemplate

Returns:

ChatBuilder

Returns the current ChatBuilder instance.

Specifies the field name in the data source from which the message text content will be read.

C#
public ChatBuilder TextField(string value)
Parameters:valuestring

The value for TextField

Returns:

ChatBuilder

Returns the current ChatBuilder instance.

Specifies the field name in the data source from which the message timestamp will be read.

C#
public ChatBuilder TimestampField(string value)
Parameters:valuestring

The value for TimestampField

Returns:

ChatBuilder

Returns the current ChatBuilder instance.

The 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.

C#
public ChatBuilder TimestampTemplate<TModel>(TemplateBuilder<TModel> template)
Parameters:templateTemplateBuilder<TModel>

A Template component that configures the timestamptemplate.

Returns:

ChatBuilder

Returns the current ChatBuilder instance.

The 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.

C#
public ChatBuilder TimestampTemplateHandler(string templateHandler)
Parameters:templateHandlerstring

The handler that returs the template for TimestampTemplate

Returns:

ChatBuilder

Returns the current ChatBuilder instance.

The 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.

C#
[Obsolete("TimestampTemplateId is obsolete. Please use TimestampTemplateHandler or TimestampTemplate instead.")]
public ChatBuilder TimestampTemplateId(string templateId)
Parameters:templateIdstring

The ID of the template element for TimestampTemplate

Returns:

ChatBuilder

Returns the current ChatBuilder instance.

Controls the visibility of message timestamps.

C#
public ChatBuilder TimestampVisibility(ChatTimestampVisibility value)
Parameters:valueChatTimestampVisibility

The value for TimestampVisibility

Returns:

ChatBuilder

Returns the current ChatBuilder instance.

Configures the toolbar of the Chat.

C#
[Obsolete("This option is obsolete since Q3 2025 and will be removed in future releases.")]
public ChatBuilder Toolbar(Action<ChatToolbarSettingsBuilder> configurator)
Parameters:configuratorAction<ChatToolbarSettingsBuilder>

The ChatToolbarSettingsBuilder for the toolbar setting.

Returns:

ChatBuilder

Returns the current instance of ChatBuilder .

Configures the user information of the Chat.

C#
[Obsolete("This option is obsolete since Q3 2025 and will be removed in future releases.")]
public ChatBuilder User(Action<ChatUserSettingsBuilder> configurator)
Parameters:configuratorAction<ChatUserSettingsBuilder>

The ChatUserSettingsBuilder for the user setting.

Returns:

ChatBuilder

Returns the current instance of ChatBuilder .

The template used to render the user status content shown next to the latest message in a receiver group. The function receives a context object with a message field, where message.author contains the normalized author data, and should return an HTML string.

C#
public ChatBuilder UserStatusTemplate<TModel>(TemplateBuilder<TModel> template)
Parameters:templateTemplateBuilder<TModel>

A Template component that configures the userstatustemplate.

Returns:

ChatBuilder

Returns the current ChatBuilder instance.

The template used to render the user status content shown next to the latest message in a receiver group. The function receives a context object with a message field, where message.author contains the normalized author data, and should return an HTML string.

C#
public ChatBuilder UserStatusTemplateHandler(string templateHandler)
Parameters:templateHandlerstring

The handler that returs the template for UserStatusTemplate

Returns:

ChatBuilder

Returns the current ChatBuilder instance.

Sets the width of the Chat component.

C#
public ChatBuilder Width(string value)
Parameters:valuestring

The value for Width

Returns:

ChatBuilder

Returns the current ChatBuilder instance.