Skip to main content

Message Actions

Add custom action buttons below each bot message — useful for thumbs up/down feedback, copy, share, and more.

Custom Message Actions

Add action buttons (copy, thumbs up/down) below each bot message via messageActions. Clicks trigger onMessageAction with the actionId and the message object.

Click Log

Click a message action button

Loading...

Example

<Chatbot
messageActions={(message) => [
{ id: "copy", label: "📋 Copy" },
{ id: "thumbs-up", label: "👍" },
{ id: "thumbs-down", label: "👎" },
]}
onMessageAction={(actionId, message) => {
console.log(actionId, message.messageId);
// Send to your analytics / feedback API
}}
{...rest}
/>

MessageActionConfig

FieldTypeDescription
idstringUnique action ID
labelstringButton display label

messageActions is a function that receives a ConversationBotMessage and returns MessageActionConfig[]. You can vary the actions based on message content.