tencent cloud

Chat

News and Announcements
Release Notes
Announcements
Product Introduction
Overview
Basic Concepts
Scenarios
Features
Account System
User Profile and Relationship Chain
Message Management
Group Related
Official Account
Audio/Video Call
Use Limits
Purchase Guide
Billing Overview
Pricing
Purchase Instructions
Renewal Guide
Service Suspension Explanation
Refund Policy
Development Guidelines
Demo Zone
Activate Service
Free Demos
Quick Run
Download
SDK and Demo Source Code
Update Log
Chat Interaction (UI Included)
TUIKit Introduction
Getting Started
Full-feature Integration
Single-function Integration
Build with AI
Build Basic Interfaces
More Features
Customizing Appearance
Internationalization
Push Service
Overview
Noun explanation
Activate the Service
Quick Start
Manufacturer Channel
Statistics
Troubleshooting Tool
Client APIs
REST API
Push Callback
Advanced Features
Release Notes
Error Codes
FAQS
Desk
Overview
Quick Start
Integration Guide
Admin Operation Manual
Agent Manual
More Practices
Live Streaming Setup Guide
AI Chatbot
Super Large Entertainment and Collaboration Community
Discord Implementation Guide
How to Integrate Chat into Games
WhatsApp Channel-style Official Account Integration Solution
Send Red Packet
Firewall Restrictions
No UI Integration
Quick Start
SDK Integration
Initialization
Login and Logout
Message
Conversation
Group
Community Topic
User Profile and Relationship Chain
Offline Push
Cloud Search
Local Search
Official Channel Management
Client APIs
JavaScript
Android
iOS & macOS
Swift
Flutter
Electron
Unity
React Native
C APIs
C++
Server APIs
Secure authentication with UserSig
RESTful APIs
Webhooks
Console Guide
New Console Introduction
Creating and Upgrading an Application
Basic Configuration
Feature Configuration
Account Management
Group Management
Official Channel Management
Webhook Configuration
Usage
Viewing Guide for Resource Packages
Real-Time Monitor
Auxiliary Development Tools
Access Management
Advanced Features
FAQs
uni-app FAQs
Purchase
SDK
Account Authentication
User Profile and Relationship Chain
Message
Group
Audio-Video Group
Nickname and Profile Photo
Security Compliance Certification
Service Level Agreement
Security Compliance Certification
Chat Policies
Privacy Policy
Data Privacy and Security Agreement
Migration
Migration Solutions
Migration Solutions Lite
Error Codes
Contact Us

ConversationPreview

PDF
Focus Mode
Font Size
Last updated: 2025-07-22 16:06:20
ConversationPreview is used for previewing session content in the list. The component displays session information, unread count, and provides conversation action feature.
With the aid of atomic information display components, you can freely design and combine your desired ConversationPreview layout.
Meanwhile, you can also use the onConversationSelect function to define selected session behavior.

Basic Usage

You can use the Preview property of ConversationList to customize the preview item for each individual conversation in the list. If the Preview property is not specified, the system will automatically adopt the ConversationPreviewUI component as the default value.
import { ConversationList, ConversationPreviewUI } from '@tencentcloud/chat-uikit-react';
import type { ConversationPreviewUIProps } from '@tencentcloud/chat-uikit-react';

const CustomConversationPreview = (props: ConversationPreviewUIProps) => {
const { Title } = props;
return (
<ConversationPreviewUI {...props}>
{Title}
<div>Your custom preview UI</div>
</ConversationPreviewUI>
);
};

<ConversationList Preview={CustomConversationPreviewUI}></ConversationList>

Props

Parameter Name
Type
Default Value
Description
conversation(Required)
ConversationModel
-
Required parameter to indicate the currently rendered conversation list item.
isSelected
Boolean
false
Control if the conversation list item UI is in selected status.
enableActions
Boolean
true
Control whether to display the conversation operation feature.
actionsConfig
-
For custom session operation configuration.
highlightMatchString
String
-
Conversation list item Title highlights matching keywords, commonly used for Conversation Search results.
Title
String | JSX.Element
ConversationPreviewTitle
Render the title area of the conversation list item.
LastMessageAbstract
String | JSX.Element
ConversationPreviewAbstract
Render the latest message abstract area of the conversation list item.
LastMessageTimestamp
String | JSX.Element
ConversationPreviewTimestamp
Render the latest message timestamp area of the conversation list item.
Unread
String | JSX.Element
ConversationPreviewUnread
Render the unread indicator area of the conversation list item.
ConversationActions
ReactElement
ConversationActions
Render the conversation operations area of the conversation list item.
Avatar
ReactElement
Avatar
Render the avatar area of the conversation list item.
onConversationSelect
(conversation: ConversationModel) => void;
-
Specify the attributes of receiving callback when selecting a dialogue in the conversation list.
className
String
-
Set a custom name for the root element class in CSS.
style
React.CSSProperties
-
Set custom styles for the root element.

Custom Case

Discord-Like Style

Discord is a popular chat application, similar to Skype or Telegram. The message content in Discord is as shown below:

By customizing the ConversationPreview layout, features, and style, we can quickly achieve a Discord-like effect.
React
CSS
1. Customize the ConversationListPreview
2. Switch theme to dark mode
import { UIKitProvider, ConversationList, ConversationPreviewUI } from '@tencentcloud/chat-uikit-react';
import type { ConversationPreviewUIProps } from '@tencentcloud/chat-uikit-react';

const CustomConversationPreview = (props: ConversationPreviewUIProps) => {
const { Title } = props;
return (
<ConversationPreviewUI {...props}>
<span> # </span>
<span>{Title}</span>
</ConversationPreviewUI>
);
};

const App = () => {
<UIKitProvider theme={'dark'}>
<ConversationList
style={{ maxWidth: '300px', height: '600px' }}
Preview={CustomConversationPreviewUI}
/>
...
</UIKitProvider>
}
.custom-preview-ui {
height: 34px;
border-radius: 6px;
padding: 10px;
margin: 0 10px;
.custom-preview-ui__tag {
margin-right: 10px;
font-size: 16px;
color: #b3b3b4;
}
.custom-preview-ui__title {
font-size: 14px;
color: #b3b3b4;
}
&.uikit-conversation-preview--active {
background-color: #3b3d43;
.custom-preview-ui__tag {
color: #ffffff;
}
.custom-preview-ui__title {
.uikit-conversation-preview__title {
color: #ffffff;
}
}
}
}
ConversationListPreview effect as follows after customization:
Before Modification
Modified












Help and Support

Was this page helpful?

Help us improve! Rate your documentation experience in 5 mins.

Feedback