Documentation Index
Fetch the complete documentation index at: https://cometchat-22654f5b-react-uikit-v7.mintlify.app/llms.txt
Use this file to discover all available pages before exploring further.
AI Integration Quick Reference
AI Integration Quick Reference
Where It Fits
CometChatConversationSummary is a base component that displays an AI-generated summary of a conversation inside a card. It is typically rendered inside a message list panel or a sidebar to give users a quick overview of the conversation. The consumer provides a getConversationSummary function (usually from an AI plugin or custom service), and the component handles loading, error, and empty states automatically.
Minimal Render
.cometchat-conversation-summary
Actions and Events
Callback Props
onClose
Called when the user clicks the close button or presses the Escape key while the component is focused.onRetry (Error sub-component)
Called when the user clicks the retry button in the error state. Falls back to the internalretry() method if not provided.
Custom View Slots
| Slot | Sub-component | Replaces |
|---|---|---|
| Header | <CometChatConversationSummary.Header> | Default header with title and close button |
| Body | <CometChatConversationSummary.Body> | Default summary text rendering |
| Loading | <CometChatConversationSummary.Loading> | Default shimmer bars |
| Error | <CometChatConversationSummary.Error> | Default error message with retry |
| Empty | <CometChatConversationSummary.Empty> | Default empty message |
Custom Header
Passchildren to Header to replace the default title and close button.
Custom Error with Retry
Passchildren to Error to fully replace the error view.
Custom Loading
Passchildren to Loading to replace the default shimmer bars.
Common Patterns
Without Header (Headless Usage)
Omit theHeader sub-component to render just the body content.
Custom Header Title
Without Close Button
CSS Architecture
The component uses CSS custom properties (design tokens) defined in@cometchat/chat-uikit-react/css-variables.css. The cascade:
- Global tokens set on the
.cometchatroot wrapper. - Component CSS (
.cometchat-conversation-summary) consumes these tokens viavar(). - Overrides target
.cometchat-conversation-summarydescendant selectors.
Key Selectors
| Target | Selector |
|---|---|
| Root card | .cometchat-conversation-summary |
| Header row | .cometchat-conversation-summary__header |
| Header title | .cometchat-conversation-summary__header-title |
| Close button | .cometchat-conversation-summary__header-close-button |
| Body | .cometchat-conversation-summary__body |
| Shimmer container | .cometchat-conversation-summary__shimmer-container |
| Shimmer bar | .cometchat-conversation-summary__shimmer-item |
| Error view | .cometchat-conversation-summary__error-view |
| Retry button | .cometchat-conversation-summary__error-retry |
| Empty view | .cometchat-conversation-summary__empty-view |
Example: Brand-themed summary card
App.css
Customization Matrix
| What to change | Where | Property/API | Example |
|---|---|---|---|
| Close behavior | Root props | onClose callback | onClose={() => hide()} |
| Header text | Header props | title | title="Chat Summary" |
| Hide close button | Header props | showCloseButton | showCloseButton={false} |
| Error message | Error props | message | message="Failed" |
| Retry behavior | Error props | onRetry | onRetry={() => refetch()} |
| Empty message | Empty props | message | message="Nothing here" |
| Shimmer count | Loading props | count | count={5} |
| Replace any section | Sub-component | children | Pass custom JSX |
| Change visual styling | Global CSS | .cometchat-conversation-summary selectors | See CSS Selectors |
Props
All props are optional unless noted otherwise.getConversationSummary (Root)
Async function that returns a summary string. Required.| Type | () => Promise<string> |
| Default | — |
onClose (Root)
Callback when the close button is clicked or Escape is pressed.| Type | () => void |
| Default | undefined |
className (Root, Header, Body, Loading, Error, Empty)
Optional custom CSS class name appended to the component’s root element.| Type | string |
| Default | undefined |
children (Root, Header, Body, Loading, Error, Empty)
Custom content that replaces the default rendering of the sub-component.| Type | ReactNode |
| Default | undefined |
title (Header)
Custom title text displayed in the header.| Type | string |
| Default | "Conversation summary" |
showCloseButton (Header)
Whether to show the close button in the header.| Type | boolean |
| Default | true |
count (Loading)
Number of shimmer bars to display during loading.| Type | number |
| Default | 3 |
message (Error)
Custom error message text.| Type | string |
| Default | "Looks like something went wrong" |
onRetry (Error)
Callback to retry fetching the summary. Falls back to the internal retry mechanism if not provided.| Type | () => void |
| Default | undefined |
message (Empty)
Custom empty state message text.| Type | string |
| Default | "No Summary Available" |
CSS Selectors
| Target | Selector |
|---|---|
| Root card | .cometchat-conversation-summary |
| Header row | .cometchat-conversation-summary__header |
| Header title | .cometchat-conversation-summary__header-title |
| Close button | .cometchat-conversation-summary__header-close-button |
| Body content | .cometchat-conversation-summary__body |
| Shimmer container | .cometchat-conversation-summary__shimmer-container |
| Shimmer bar | .cometchat-conversation-summary__shimmer-item |
| Error view | .cometchat-conversation-summary__error-view |
| Retry button | .cometchat-conversation-summary__error-retry |
| Empty view | .cometchat-conversation-summary__empty-view |