Syncfusion Vue Chat UI Component
The Syncfusion Vue Chat UI component provides a modern, feature-rich interface for building conversational applications. It supports real-time messaging, user avatars, typing indicators, file attachments, message replies, mentions, timestamps, and bot integrations.
Component Overview
The Vue Chat UI component (ejs-chatui) provides:
- Message Management: Add, update, and display messages with rich metadata (author, timestamp, status)
- User System: Define current user and other participants with avatars, names, and status indicators
- Interactive Features: Message replies, pinning, forwarding, toolbar actions, and @mentions
- File Attachments: Upload, preview, and display files with drag-and-drop support
- Templates: Customize messages, suggestions, empty states, typing indicators, attachments, and time breaks
- Events: Handle message sending, user typing, attachment uploads, mention selection, and toolbar clicks
- Accessibility: Built-in WCAG compliance, keyboard navigation, and RTL support
- Bot Integration: Connect with Microsoft Bot Framework and Dialogflow
Package: @syncfusion/ej2-vue-interactive-chat
Vue Support: Vue 3
Dependencies: Base, Inputs, Navigations, Buttons, Popups, Dropdowns, Splitbuttons
Documentation and Navigation Guide
Getting Started
📄 Read: references/getting-started.md
- Installation and package setup (
@syncfusion/ej2-vue-interactive-chat)
- Basic Chat UI implementation
- CSS imports and Material3 theme configuration
- Component registration and first render
- Defining messages with
<e-messages> and <e-message> directives
- Setting up current user
Messages Configuration
📄 Read: references/messages.md
- Message model structure (text, author, timestamp, id)
- Adding messages with
<e-message> selector
- Message properties: isPinned, isForwarded, replyTo
- Message status with icons and tooltips
- Attached files in messages
- Mention users in message text
- Message IDs for tracking and updates
Users and Avatars
📄 Read: references/users.md
- User model configuration (id, user, avatarUrl)
- Current user vs other participants
- Avatar display (URL or initials fallback)
- Avatar background colors customization
- Status icons with cssClass
- Typing users list and indicators
- User CSS class customization
Appearance and Styling
📄 Read: references/appearance.md
- Component dimensions (height, width)
- CSS class customization with cssClass property
- RTL (right-to-left) support
- Compact mode layout (all messages left-aligned)
- Empty chat template for no messages
- Persistence across page reloads
- Theming with Material3, Bootstrap, Fabric
Header and Footer Configuration
📄 Read: references/header-footer.md
- Header text and icon configuration
- Header toolbar settings and items
- Toolbar item configuration (text, icon, tooltip, align)
- Show/hide header with showHeader property
- Show/hide footer with showFooter property
- Footer template customization
- Placeholder text for input textarea
- Toolbar item click events
Timestamps and Time Breaks
📄 Read: references/timestamps-timebreaks.md
- Show/hide timestamps with showTimeStamp
- Timestamp format customization
- Time breaks for date-based grouping
- Custom time break templates
- Localization and culture-specific formats
- Per-message timestamp formats
Advanced Features
📄 Read: references/advanced-features.md
- @Mention functionality with trigger character
- Mention users list and suggestion popup
- File attachments configuration (saveUrl, allowed types, max size)
- Drag-and-drop attachments
- Message toolbar (Reply, Pin, Delete, Copy, Forward)
- Message toolbar customization and events
- Load on demand for message history
- Auto scroll to bottom for new messages
- Suggestions above input textarea
Templates
📄 Read: references/templates.md
- Message template for custom message rendering
- Suggestion template for suggestion items
- Typing users template for typing indicators
- Empty chat template for no messages state
- Footer template for custom footer
- Attachment template for file display in footer
- Preview template for attachment previews
- Time break template for date separators
- Template context data (message, index, suggestion)
Events and Methods
📄 Read: references/events-methods.md
- created event (component initialization)
- messageSend event (before message sent)
- userTyping event (typing indicators)
- mentionSelect event (mention selection)
- Attachment events (beforeUpload, success, failure, removed)
- Toolbar item click events (header and message toolbars)
- addMessage() method to append messages
- updateMessage() method to modify messages
- scrollToBottom() method for navigation
- scrollToMessage() method to scroll to specific message
- focus() method for input textarea
Bot Integrations
📄 Read: references/bot-integrations.md
- Integration with Microsoft Bot Framework
- Integration with Google Dialogflow
- Bot message handling and responses
- Connecting to bot services
- Sample bot conversation flows
- Handling bot-initiated messages
Quick Start
Basic Chat UI
<template>
<div id="container" style="height: 400px; width: 500px;">
<ejs-chatui :user="currentUser">
<e-messages>
<e-message
:author="currentUser"
text="Hello! How can I help you today?"
></e-message>
<e-message
:author="supportUser"
text="Hi! I need assistance with my order."
></e-message>
</e-messages>
</ejs-chatui>
</div>
</template>
<script setup>
import {
ChatUIComponent as EjsChatui,
MessagesDirective as EMessages,
MessageDirective as EMessage
} from "@syncfusion/ej2-vue-interactive-chat";
const currentUser = {
id: "user1",
user: "Albert",
avatarUrl: "./albert.png"
};
const supportUser = {
id: "user2",
user: "Support Agent",
avatarUrl: "./support.png"
};
</script>
<style>
@import "../node_modules/@syncfusion/ej2-material3-theme/styles/chat-ui/index.css";
</style>
Common Patterns
Dynamic Message Handling
<script setup>
import { ref } from 'vue';
import { ChatUIComponent as EjsChatui } from "@syncfusion/ej2-vue-interactive-chat";
const chatRef = ref(null);
// Add message dynamically
const sendMessage = (text) => {
chatRef.value.addMessage({
text: text,
author: currentUser,
timestamp: new Date()
});
};
// Handle message send event
const => {
console.log('Message sent:', args.message);
// Send to backend or bot service
};
</script>
<template>
<ejs-chatui
ref="chatRef"
:user="currentUser"
:messageSend="onMessageSend"
></ejs-chatui>
</template>
Message Replies and Threading
<e-message
:author="currentUser"
text="I've completed the review."
:replyTo="{
messageID: 'msg-123',
text: 'Can you review the document?',
user: otherUser,
timestamp: new Date('2026-03-27T10:00:00')
}"
></e-message>
File Attachments
<ejs-chatui
:user="currentUser"
:enableAttachments="true"
:attachmentSettings="{
saveUrl: 'https://api.example.com/upload',
allowedFileTypes: '.jpg,.png,.pdf,.docx',
maxFileSize: 5242880,
maximumCount: 3
}"
:beforeAttachmentUpload="handleBeforeUpload"
:attachmentUploadSuccess="handleUploadSuccess"
></ejs-chatui>
@Mentions
<ejs-chatui
:user="currentUser"
mentionTriggerChar="@"
:mentionUsers="[
{ id: 'u1', user: 'Alice' },
{ id: 'u2', user: 'Bob' },
{ id: 'u3', user: 'Charlie' }
]"
:mentionSelect="handleMentionSelect"
></ejs-chatui>
1---2name: syncfusion-vue-chat-ui3description: Implement the Syncfusion Vue Chat UI component for Vue chat interfaces, messaging applications, conversational UI, chat widgets, real-time messaging, user-to-user communication, bot integrations, customer support chat, collaborative messaging, instant messaging features, chat rooms, or when user mentions "chat ui", "chat component", "messaging interface", "conversation view", or @syncfusion/ej2-vue-interactive-chat package.4---56# Syncfusion Vue Chat UI Component78The Syncfusion Vue Chat UI component provides a modern, feature-rich interface for building conversational applications. It supports real-time messaging, user avatars, typing indicators, file attachments, message replies, mentions, timestamps, and bot integrations.910## Component Overview1112The Vue Chat UI component (`ejs-chatui`) provides:1314- **Message Management**: Add, update, and display messages with rich metadata (author, timestamp, status)15- **User System**: Define current user and other participants with avatars, names, and status indicators16- **Interactive Features**: Message replies, pinning, forwarding, toolbar actions, and @mentions17- **File Attachments**: Upload, preview, and display files with drag-and-drop support18- **Templates**: Customize messages, suggestions, empty states, typing indicators, attachments, and time breaks19- **Events**: Handle message sending, user typing, attachment uploads, mention selection, and toolbar clicks20- **Accessibility**: Built-in WCAG compliance, keyboard navigation, and RTL support21- **Bot Integration**: Connect with Microsoft Bot Framework and Dialogflow2223**Package**: `@syncfusion/ej2-vue-interactive-chat` 24**Vue Support**: Vue 325**Dependencies**: Base, Inputs, Navigations, Buttons, Popups, Dropdowns, Splitbuttons2627## Documentation and Navigation Guide2829### Getting Started30📄 **Read:** [references/getting-started.md](references/getting-started.md)31- Installation and package setup (`@syncfusion/ej2-vue-interactive-chat`)32- Basic Chat UI implementation33- CSS imports and Material3 theme configuration34- Component registration and first render35- Defining messages with `<e-messages>` and `<e-message>` directives36- Setting up current user3738### Messages Configuration39📄 **Read:** [references/messages.md](references/messages.md)40- Message model structure (text, author, timestamp, id)41- Adding messages with `<e-message>` selector42- Message properties: isPinned, isForwarded, replyTo43- Message status with icons and tooltips44- Attached files in messages45- Mention users in message text46- Message IDs for tracking and updates4748### Users and Avatars49📄 **Read:** [references/users.md](references/users.md)50- User model configuration (id, user, avatarUrl)51- Current user vs other participants52- Avatar display (URL or initials fallback)53- Avatar background colors customization54- Status icons with cssClass55- Typing users list and indicators56- User CSS class customization5758### Appearance and Styling59📄 **Read:** [references/appearance.md](references/appearance.md)60- Component dimensions (height, width)61- CSS class customization with cssClass property62- RTL (right-to-left) support63- Compact mode layout (all messages left-aligned)64- Empty chat template for no messages65- Persistence across page reloads66- Theming with Material3, Bootstrap, Fabric6768### Header and Footer Configuration69📄 **Read:** [references/header-footer.md](references/header-footer.md)70- Header text and icon configuration71- Header toolbar settings and items72- Toolbar item configuration (text, icon, tooltip, align)73- Show/hide header with showHeader property74- Show/hide footer with showFooter property75- Footer template customization76- Placeholder text for input textarea77- Toolbar item click events7879### Timestamps and Time Breaks80📄 **Read:** [references/timestamps-timebreaks.md](references/timestamps-timebreaks.md)81- Show/hide timestamps with showTimeStamp82- Timestamp format customization83- Time breaks for date-based grouping84- Custom time break templates85- Localization and culture-specific formats86- Per-message timestamp formats8788### Advanced Features89📄 **Read:** [references/advanced-features.md](references/advanced-features.md)90- @Mention functionality with trigger character91- Mention users list and suggestion popup92- File attachments configuration (saveUrl, allowed types, max size)93- Drag-and-drop attachments94- Message toolbar (Reply, Pin, Delete, Copy, Forward)95- Message toolbar customization and events96- Load on demand for message history97- Auto scroll to bottom for new messages98- Suggestions above input textarea99100### Templates101📄 **Read:** [references/templates.md](references/templates.md)102- Message template for custom message rendering103- Suggestion template for suggestion items104- Typing users template for typing indicators105- Empty chat template for no messages state106- Footer template for custom footer107- Attachment template for file display in footer108- Preview template for attachment previews109- Time break template for date separators110- Template context data (message, index, suggestion)111112### Events and Methods113📄 **Read:** [references/events-methods.md](references/events-methods.md)114- created event (component initialization)115- messageSend event (before message sent)116- userTyping event (typing indicators)117- mentionSelect event (mention selection)118- Attachment events (beforeUpload, success, failure, removed)119- Toolbar item click events (header and message toolbars)120- addMessage() method to append messages121- updateMessage() method to modify messages122- scrollToBottom() method for navigation123- scrollToMessage() method to scroll to specific message124- focus() method for input textarea125126### Bot Integrations127📄 **Read:** [references/bot-integrations.md](references/bot-integrations.md)128- Integration with Microsoft Bot Framework129- Integration with Google Dialogflow130- Bot message handling and responses131- Connecting to bot services132- Sample bot conversation flows133- Handling bot-initiated messages134135## Quick Start136137### Basic Chat UI138139```vue140<template>141 <div id="container" style="height: 400px; width: 500px;">142 <ejs-chatui :user="currentUser">143 <e-messages>144 <e-message 145 :author="currentUser" 146 text="Hello! How can I help you today?"147 ></e-message>148 <e-message 149 :author="supportUser" 150 text="Hi! I need assistance with my order."151 ></e-message>152 </e-messages>153 </ejs-chatui>154 </div>155</template>156157<script setup>158import { 159 ChatUIComponent as EjsChatui, 160 MessagesDirective as EMessages, 161 MessageDirective as EMessage 162} from "@syncfusion/ej2-vue-interactive-chat";163164const currentUser = {165 id: "user1",166 user: "Albert",167 avatarUrl: "./albert.png"168};169170const supportUser = {171 id: "user2",172 user: "Support Agent",173 avatarUrl: "./support.png"174};175</script>176177<style>178@import "../node_modules/@syncfusion/ej2-material3-theme/styles/chat-ui/index.css";179</style>180```181182## Common Patterns183184### Dynamic Message Handling185186```vue187<script setup>188import { ref } from 'vue';189import { ChatUIComponent as EjsChatui } from "@syncfusion/ej2-vue-interactive-chat";190191const chatRef = ref(null);192193// Add message dynamically194const sendMessage = (text) => {195 chatRef.value.addMessage({196 text: text,197 author: currentUser,198 timestamp: new Date()199 });200};201202// Handle message send event203const onMessageSend = (args) => {204 console.log('Message sent:', args.message);205 // Send to backend or bot service206};207</script>208209<template>210 <ejs-chatui 211 ref="chatRef"212 :user="currentUser"213 :messageSend="onMessageSend"214 ></ejs-chatui>215</template>216```217218### Message Replies and Threading219220```vue221<e-message 222 :author="currentUser" 223 text="I've completed the review."224 :replyTo="{225 messageID: 'msg-123',226 text: 'Can you review the document?',227 user: otherUser,228 timestamp: new Date('2026-03-27T10:00:00')229 }"230></e-message>231```232233### File Attachments234235```vue236<ejs-chatui 237 :user="currentUser"238 :enableAttachments="true"239 :attachmentSettings="{240 saveUrl: 'https://api.example.com/upload',241 allowedFileTypes: '.jpg,.png,.pdf,.docx',242 maxFileSize: 5242880,243 maximumCount: 3244 }"245 :beforeAttachmentUpload="handleBeforeUpload"246 :attachmentUploadSuccess="handleUploadSuccess"247></ejs-chatui>248```249250### @Mentions251252```vue253<ejs-chatui 254 :user="currentUser"255 mentionTriggerChar="@"256 :mentionUsers="[257 { id: 'u1', user: 'Alice' },258 { id: 'u2', user: 'Bob' },259 { id: 'u3', user: 'Charlie' }260 ]"261 :mentionSelect="handleMentionSelect"262></ejs-chatui>263```