Syncfusion React Chat Ui

syncfusion/react-ui-components-skills/skills/syncfusion-react-chat-ui

作者 syncfusion6fb1c883a8412b611b95f839e0cb06e1fc8170a8无许可证收录于 2026年10月9日更新于 2026年10月9日

Implement the Syncfusion React Chat UI component. Use this skill to create and customize messaging interfaces, including chat setup, message rendering, file attachments, typing indicators, conversation layout, theming, event handling, and real-time updates in React applications.

AI 生成的概览

指导实现 Syncfusion React Chat UI 组件,用于在 React 应用中构建消息界面。

功能
该技能提供实现 Syncfusion React Chat UI 组件的说明与参考资料。内容涵盖组件初始化、消息渲染与管理、用户配置、文件附件、输入指示器、模板系统、页眉与工具栏定制、时间戳、提及、事件处理以及全球化与 RTL 支持。它产出的是构建聊天界面的指导与代码示例,而非运行脚本。
适用场景
适用于在 React 应用中使用 Syncfusion Chat UI 组件构建或定制对话界面的场景。适合客服聊天、团队协作视图以及多语言或 RTL 消息界面。
运行要求
需要 React 应用和 Syncfusion React 交互式聊天包,并需了解该组件的属性与模板。该技能不附带脚本,仅为说明与参考文档。

Syncfusion React Chat-UI in Syncfusion React

Component Overview

The Chat-UI component provides a complete conversational interface with real-time messaging, file attachments, user presence, and extensive customization options. This skill guides you through implementing chat interfaces for customer support, team collaboration, and interactive applications.

Key Capabilities

The Chat-UI component is an interactive messaging interface featuring:

  • Rich Message Support: Text, markdown, formatted content
  • User Management: Multi-user conversations, presence status, avatars
  • File Attachments: Upload, preview, download with restrictions
  • Event System: Lifecycle, interaction, and attachment events
  • Templates: Customizable UI for messages, suggestions, footer
  • Internationalization: Multi-language and RTL support

Documentation Navigation

Getting Started

📄 Read: references/getting-started.md [blocked]

  • Package installation
  • Basic component initialization
  • CSS theming and imports

Message Management

📄 Read: references/message-management.md [blocked]

  • Adding and updating messages
  • Auto-scroll to latest messages
  • Progressive message loading (on-demand)
  • Message configuration (pinned, reply, forward)
  • Message status tracking
  • Message toolbar customization

User Configuration

📄 Read: references/user-configuration.md [blocked]

  • User model setup
  • Avatar customization
  • User presence status
  • CSS class customization

Events and Interactions

📄 Read: references/events-and-interactions.md [blocked]

  • Component lifecycle events
  • Message sending events
  • User typing events (with complete event arguments)
  • Attachment upload and click events
  • Toolbar click events

Templating System

📄 Read: references/templating-system.md [blocked]

  • Empty chat template
  • Message custom rendering
  • Time break template
  • Typing indicator template
  • Suggestion template
  • Footer template customization

File Attachments

📄 Read: references/file-attachments.md [blocked]

  • Enable attachment support
  • Configure upload endpoints
  • File type and size restrictions
  • Drag-and-drop support
  • Attachment templates (preview and footer)
  • Handle attachment click events

Header Customization

📄 Read: references/header-customization.md [blocked]

  • Header visibility and text
  • Header icon styling
  • Toolbar configuration
  • Toolbar item types and events

Appearance and Styling

📄 Read: references/appearance-styling.md [blocked]

  • Pompact mode layout for dense conversations
  • Claceholder text configuration
  • Width and height customization
  • CSS class application
  • Component-level styling

Timestamp and Time Breaks

📄 Read: references/timestamp-and-timebreaks.md [blocked]

  • Show/hide timestamps
  • Timestamp format customization
  • Time break separators
  • Date-wise organization

Typing Indicator

📄 Read: references/typing-indicator.md [blocked]

  • Show/hide typing indicator
  • Multi-user typing display
  • Typing indicator template customization

Mention Integration

📄 Read: references/mention-integration.md [blocked]

  • Configure mentionable users
  • Customize mention trigger character
  • Predefined mentions in messages
  • Mention selection events

Globalization and RTL

📄 Read: references/globalization-rtl.md [blocked]

  • Localization and language support
  • Right-to-Left (RTL) layout
  • Typing indicator localization

Quick Start Example

tsx
import { ChatUIComponent, MessagesDirective, MessageDirective, UserModel } from '@syncfusion/ej2-react-interactive-chat';import * as React from 'react';import * as ReactDOM from "react-dom";
function App() {    const currentUserModel: UserModel = {        id: "user1",        user: "Albert"    };
    const otherUserModel: UserModel = {        id: "user2",        user: "Michale Suyama"    };
    return (        <ChatUIComponent user={currentUserModel} headerText="Chat Support">            <MessagesDirective>                <MessageDirective text="Hello, how can I help?" author={currentUserModel} />                <MessageDirective text="I need assistance with my order." author={otherUserModel} />            </MessagesDirective>        </ChatUIComponent>    );}
ReactDOM.render(<App />, document.getElementById('container'));

Common Patterns

Create a Support Chat Interface

tsx
<ChatUIComponent   user={currentUser}  headerText="Support Chat"  enableAttachments={true}  showTimeStamp={true}  showHeader={true}  messageToolbarSettings={{ items: ['Copy', 'Reply', 'Delete'] }}>  <MessagesDirective>    {/* messages populate here */}  </MessagesDirective></ChatUIComponent>

Add Message Dynamically

tsx
const chatRef = useRef<ChatUIComponent>(null);
const addNewMessage = () => {  chatRef.current.addMessage({    author: userModel,    text: "Your message here",    timeStamp: new Date()  });};

Configure Multiple Templates

Implement messageTemplate, emptyChatTemplate, timeBreakTemplate, and suggestionTemplate for complete customization.

Key Props

PropTypePurpose
userUserModelCurrent logged-in user
messagesMessageModel[]Initial message list
headerTextstringHeader title
placeholderstringInput field hint
enableAttachmentsbooleanFile upload support
showTimeStampbooleanDisplay message timestamps
showHeaderbooleanShow header section
showFooterbooleanShow input footer
autoScrollToBottombooleanAuto-scroll to latest message
loadOnDemandbooleanProgressive message loading
enableCompactModebooleanLeft-aligned compact layout
enableRtlbooleanRight-to-left layout
localestringLanguage/culture code

Common Use Cases

Use Case 1: Customer Support Chat

  • Multiple support agents handling customer queries
  • File attachment for screenshots and auto-scroll
  • Typing indicators to show agent engagement
  • Progressive loading for long conversation histories
  • Typing indicators to show agent engagement

Use Case 2: Team Collaboration

  • Mention team members with @
  • Compact mode for group conversations
  • Pin important discussions
  • Forward messages for reference
  • Message editing and deletion

Use Case 3: Multilingual Chat Application

  • RTL support for Arabic/Hebrew
  • Localized UI strings
  • Support for multiple cultures

For complete examples and advanced scenarios, explore individual reference files above.

来源与署名

来源:syncfusion/react-ui-components-skills位于skills/syncfusion-react-chat-ui提交6fb1c88

许可证: 无许可证

内容归原作者所有。SourceWeft 从公开仓库中收录这些内容。

举报或申请下架