Class ChatUI
Inheritance
Namespace: Syncfusion.EJ2.InteractiveChat
Assembly: Syncfusion.EJ2.dll
Syntax
public class ChatUI : EJTagHelper
Constructors
ChatUI()
Declaration
public ChatUI()
Properties
AutoScrollToBottom
Specifies whether the UI should automatically scroll to the bottom when a new message is added to the Chat UI component.
When set to true
, the chat will automatically scroll to display the latest message, ensuring that users can see new messages without manual intervention.
Declaration
public bool AutoScrollToBottom { get; set; }
Property Value
Type | Description |
---|---|
System.Boolean | The default value is false |
ContentTemplate
To get or set value for ContentTemplate.
Declaration
public MvcTemplate<object> ContentTemplate { get; set; }
Property Value
Type |
---|
Syncfusion.EJ2.MvcTemplate<System.Object> |
Created
Event triggers when the component is created.
Declaration
public string Created { get; set; }
Property Value
Type | Description |
---|---|
System.String | The default value is null |
CssClass
Specifies custom CSS classes for the Chat UI component. This property enables the application of additional styling options to customize the visual appearance of the chat interface.
Declaration
public string CssClass { get; set; }
Property Value
Type | Description |
---|---|
System.String | The default value is "" |
EmptyChatTemplate
Specifies the template for rendering the empty state of the Chat UI component. This property can accept either a string or a function to customize the appearance when there are no messages to display in the chat.
Declaration
public string EmptyChatTemplate { get; set; }
Property Value
Type | Description |
---|---|
System.String | The default value is "" |
EnablePersistence
Enable or disable persisting component's state between page reloads.
Declaration
public bool EnablePersistence { get; set; }
Property Value
Type | Description |
---|---|
System.Boolean | The default value is false |
EnableRtl
Enable or disable rendering component in right to left direction.
Declaration
public bool EnableRtl { get; set; }
Property Value
Type | Description |
---|---|
System.Boolean | The default value is false |
FooterTemplate
Specifies the template for the footer area in the Chat UI component. Defines the content or layout used to render the footer, which can be provided as a string or a function.
Declaration
public string FooterTemplate { get; set; }
Property Value
Type | Description |
---|---|
System.String | The default value is "" |
HeaderIconCss
Specifies the CSS class for the header icon in the Chat UI component. This property allows for custom styling of the header icon.
Declaration
public string HeaderIconCss { get; set; }
Property Value
Type | Description |
---|---|
System.String | The default value is "" |
HeaderText
Specifies the header text to be displayed in the Chat UI component. This property defines the text that appears in the header, which can indicate the current participant's username or the group name, providing context for the conversation.
Declaration
public string HeaderText { get; set; }
Property Value
Type | Description |
---|---|
System.String | The default value is "Chat" |
HeaderToolbar
Specifies the header toolbar settings for the Chat UI component. Represents the configuration for toolbar items and actions within the component.
Declaration
public ChatUIToolbarSettings HeaderToolbar { get; set; }
Property Value
Type | Description |
---|---|
ChatUIToolbarSettings | The default value is null |
Height
Specifies the height of the Chat UI component.
Declaration
public string Height { get; set; }
Property Value
Type | Description |
---|---|
System.String | The default value is "100%" |
HtmlAttributes
Allows additional HTML attributes such as title, name, etc., and accepts n number of attributes in a key-value pair format.
Declaration
public object HtmlAttributes { get; set; }
Property Value
Type |
---|
System.Object |
LoadOnDemand
Enables on-demand loading of messages, typically triggered as the user scrolls through the chat history.
When set to true
, older messages will load progressively, improving performance for large message histories by avoiding initial loading of all messages.
Declaration
public bool LoadOnDemand { get; set; }
Property Value
Type | Description |
---|---|
System.Boolean | The default value is false |
Locale
Overrides the global culture and localization value for this component. Default global culture is 'en-US'.
Declaration
public string Locale { get; set; }
Property Value
Type | Description |
---|---|
System.String | The default value is "" |
Messages
Specifies a collection of messages within the Chat UI component. Each message is represented by a MessageModel object, containing properties such as text, author, timestamp, and status.
Declaration
public List<ChatUIMessage> Messages { get; set; }
Property Value
Type | Description |
---|---|
System.Collections.Generic.List<ChatUIMessage> | The default value is null |
MessageSend
Event triggered when a message is about to be sent in the Chat UI component. This event allows for cancelling the send action if needed.
Declaration
public string MessageSend { get; set; }
Property Value
Type | Description |
---|---|
System.String | The default value is null |
MessageTemplate
Specifies the template for rendering individual messages in the Chat UI component. This property can accept either a string or a function to customize the appearance of messages. The template context includes message and index.
Declaration
public string MessageTemplate { get; set; }
Property Value
Type | Description |
---|---|
System.String | The default value is "" |
Placeholder
Specifies the placeholder text for the message input textarea in the Chat UI component.
Declaration
public string Placeholder { get; set; }
Property Value
Type | Description |
---|---|
System.String | The default value is "Type your message…" |
ShowFooter
Specifies whether to show or hide footer in the Chat UI component.
When set to true
, the footer will be visible in the Chat UI component. If false
, the footer will be hidden.
Declaration
public bool ShowFooter { get; set; }
Property Value
Type | Description |
---|---|
System.Boolean | The default value is true |
ShowHeader
Specifies whether the header is displayed in the Chat UI component.
This property controls the visibility of the header, allowing users to show or hide it as needed.
When set to false
, the header will be hidden from view.
Declaration
public bool ShowHeader { get; set; }
Property Value
Type | Description |
---|---|
System.Boolean | The default value is true |
ShowTimeBreak
Specifies whether time breaks are enabled for grouping chat messages by date.
When set to true
, messages will be grouped based on their timestamp, creating date-wise separators within the chat.
Declaration
public bool ShowTimeBreak { get; set; }
Property Value
Type | Description |
---|---|
System.Boolean | The default value is false |
ShowTimeStamp
Specifies whether timestamps are displayed alongside each message in the Chat UI component. When set to true, timestamps will appear with each message, helping users track the timing of conversations.
Declaration
public bool ShowTimeStamp { get; set; }
Property Value
Type | Description |
---|---|
System.Boolean | The default value is true |
Suggestions
Specifies the list of message suggestions displayed above the input textarea in the Chat UI component. This property represents an array of suggestions that can assist the user in composing messages, providing quick replies.
Declaration
public string[] Suggestions { get; set; }
Property Value
Type | Description |
---|---|
System.String[] | The default value is null |
SuggestionTemplate
Specifies the template for rendering suggestion items in the Chat UI component. Defines the content or layout used to render suggestion items, and can be either a string or a function. The template context includes the index and suggestion text.
Declaration
public string SuggestionTemplate { get; set; }
Property Value
Type | Description |
---|---|
System.String | The default value is "" |
TimeBreakTemplate
Defines a custom template for rendering time breaks in the Chat UI component. Accepts a string or function that formats the appearance of date-based separators, allowing customization of how messages are visually grouped by date.
Declaration
public string TimeBreakTemplate { get; set; }
Property Value
Type | Description |
---|---|
System.String | The default value is "" |
TimeStampFormat
Specifies the format of the value that to be displayed in component. By default, the format will be set based on the culture. You can set the format to "format:'dd/MM/yyyy hh:mm a'" in string.
Declaration
public string TimeStampFormat { get; set; }
Property Value
Type | Description |
---|---|
System.String | The default value is "dd/MM/yyyy hh:mm a" |
TypingUsers
Specifies a list of users who are currently typing in the chat. This property is updated to indicate active participants typing responses.
Declaration
public List<ChatUIUser> TypingUsers { get; set; }
Property Value
Type | Description |
---|---|
System.Collections.Generic.List<ChatUIUser> | The default value is null |
TypingUsersTemplate
Template for displaying users currently typing in the chat interface. Accepts a string or function to customize the display format.
Declaration
public string TypingUsersTemplate { get; set; }
Property Value
Type | Description |
---|---|
System.String | The default value is "" |
User
Represents the current user interacting with the Chat UI.
Uses the UserModel
object, which contains current user information.
Messages from the current user are displayed on the right side of the Chat UI for differentiation from other participants.
Declaration
public ChatUIUser User { get; set; }
Property Value
Type | Description |
---|---|
ChatUIUser | The default value is null |
UserTyping
Event triggered when the user is typing a message in the Chat UI component. This event provides updates on the user's typing status.
Declaration
public string UserTyping { get; set; }
Property Value
Type | Description |
---|---|
System.String | The default value is null |
Width
Specifies the width of the Chat UI component.
Declaration
public string Width { get; set; }
Property Value
Type | Description |
---|---|
System.String | The default value is "100%" |