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

ConversationActions

PDF
Focus Mode
Font Size
Last updated: 2025-07-22 16:06:20
ConversationActions component is responsible for row operations on a single session, supported by default with delete conversation, pin conversation to top/unpin, and mute/unmute features.

Basic Usage

When using ConversationActions in ConversationList, you can customize it directly through the top-level actionsConfig parameter of ConversationList. actionsConfig supports default conversation operation feature toggles, event response, adding new custom action items, and basic UI customization.
For advanced customization, you can create new components through ConversationActions.

Using ActionsConfig Basic Customization

import { UIKitProvider, ConversationList } from "@tencentcloud/chat-uikit-react";
import type { ConversationModel } from "@tencentcloud/chat-uikit-react";

const App = () => {
return (
<UIKitProvider>
<ConversationList
actionsConfig={{
enablePin: false,
onConversationDelete: (conversation: ConversationModel) => { console.log('Delete conversation success'); },
customConversationActions: {
'custom-actions-1': {
label: 'custom-actions',
onClick: (conversation: ConversationModel) => { console.log(conversation); },
},
},
}}/>
</UIKitProvider>
);
}

Custom ConversationActions Component

import { UIKitProvider, ConversationList, ConversationActions } from "@tencentcloud/chat-uikit-react";
import type { ConversationActionsProps } from '@tencentcloud/chat-uikit-react';

const CustomConversationActions = (props: ConversationActionsProps) => {
return <ConversationActions {...props} enableDelete={false} />;
};

const App = () => {
return (
<UIKitProvider>
<ConversationList
style={{ maxWidth: '300px', height: '600px' }}
ConversationActions={CustomConversationActions}
/>
</UIKitProvider>
);
}

Props

ConversationActions component API type ConversationActionsProps is based on ConversationActionsConfig API and expanded.
ConversationActionsProps
Parameter Name
Type
Default Value
Note
conversation(Required)
ConversationModel
-
This parameter is required and represents the session for the current rendered conversation operation.
className
String
-
Custom root element class name.
style
React.CSSProperties
-
Custom root element style.
ConversationActionsConfig
Parameter Name
Type
Default Value
Note
enablePin
Boolean
true
Whether to display the pin to top feature button.
enableMute
Boolean
true
Whether to display the do not disturb feature button.
enableDelete
Boolean
true
Whether to display the deletion feature button.
onConversationPin
(conversation: ConversationModel, e?: React.MouseEvent) => void
-
Customize the behavior of pinning/unpinning conversations.
onConversationMute
(conversation: ConversationModel, e?: React.MouseEvent)
=> void
-
Customize the behavior of do not disturb/cancel Do Not Disturb session.
onConversationDelete
(conversation: ConversationModel, e?: React.MouseEvent) => void
-
Customize the behavior of deleting conversations.
customConversationActions
Record<string, ConversationActionItem>
-
Custom session operation items.
PopupIcon
ReactElement
-
Custom action pop-up icon.
PopupElements
ReactElement[]
-
Content of the custom action popup.
onClick
(e: React.MouseEvent, key?: string, conversation?: ConversationModel) => void
-
Callback function for click action.

Customize Component

Basic Feature Switch

By setting the enablePin, enableDelete, and enableMute parameters, you can flexibly control the display of conversation pinning, mute message notification, and conversation deletion in ConversationActions.
<ConversationActions enablePin={false} />
<ConversationActions enableDelete={false} />
<ConversationActions enableMute={false} />
enablePin={false}
enableDelete={false}
enableMute={false}










Event Response

ConversationActions component supports delete conversation, pin conversation to top/unpin, and mute/unmute features by default. If the event response of existing functionality does not meet your needs, you can customize the event response handling function and override it. In addition to customizing feature event responses, you can also obtain basic click event response through onClick.
import { ConversationList, ConversationActions, Toast } from '@tencentcloud/chat-uikit-react';
import type { ConversationActionsProps, ConversationModel } from '@tencentcloud/chat-uikit-react';

const CustomConversationActions = (props: ConversationActionsProps) => {
return (
<ConversationActions
{...props}
onConversationDelete={(conversation: ConversationModel) => {
conversation.deleteConversation().then(() => {
Toast({ text: 'delete conversation successfully!', type: 'info' });
}).catch(() => {
Toast({ text: 'delete conversation failed!', type: 'error' });
});
}}
/>
);
};

<ConversationList ConversationActions={CustomConversationActions} />

customConversationActions

customConversationActions is used to add new custom action items to the ConversationActions list.
ConversationActionItem
Parameter Name
Type
Default Value
Note
enable
Boolean
true
Whether to enable custom action items.
label
String
-
Display content of custom action items.
onClick
(conversation: ConversationModel, e?: React.MouseEvent) => void
-
Callback function for clicking a custom action item.
Here is an example of adding new custom action items using customConversationActions:
import { ConversationList, ConversationActions } from '@tencentcloud/chat-uikit-react';
import type { ConversationActionsProps, ConversationModel } from '@tencentcloud/chat-uikit-react';

const CustomConversationActions = (props: ConversationActionsProps) => {
return (
<ConversationActions
{...props}
customConversationActions={{
'custom-actions-1': {
label: 'custom-actions',
onClick: (conversation: ConversationModel) => { console.log(conversation); },
},
}}
/>
);
};
<ConversationList ConversationActions={CustomConversationActions} />
Before modification
After modification







UI Interface Customization

You can customize the wakeup popup button style through the PopupIcon parameter and the popup content through PopupElements.
The following is example code for secondary development on the basis of the default ConversationActions component to customize a new awakening button style:
import { ConversationList, ConversationActions, ConversationActionsProps } from '@tencentcloud/chat-uikit-react';
import type { ConversationActionsProps } from '@tencentcloud/chat-uikit-react';

const CustomConversationActions = (props: ConversationActionsProps) => {
const customIcon = <div>Custom Icon</div>
return (
<ConversationActions {...props} PopupIcon={customIcon} />
);
};
<ConversationList ConversationActions={CustomConversationActions} />
Before modification
After modification
















Help and Support

Was this page helpful?

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

Feedback