AI Integration Quick Reference
AI Integration Quick Reference
CometChatSavedMessages lists every message the logged-in user has saved, newest save first. Unlike a
pin, a save is private and spans conversations — nobody else can see it, and the list is not scoped
to a single chat.
Where It Fits
Because the list is account-wide, this panel belongs at app level — a tab, a drawer entry, or a profile screen — not inside a single conversation.
Minimal Render
There is deliberately nouser or group prop. Scoping it to one conversation would defeat the point.
- TypeScript
- JavaScript
Actions and Events
Callback Props
onItemPress
Fires when a saved row is tapped. Because the rows come from different conversations, it hands you asource alongside the message so you can open the right chat.
source is null when the conversation could not be resolved. Otherwise it carries:
You can also read the routing off the message itself:
onBack
Fires when the back affordance in the header is pressed.Events
The panel keeps itself current without a manual refresh, so a save made on a phone appears on that
user’s tablet on its own.
A save is per-viewer. The same message reads saved for the user who saved it and unsaved for
everybody else — it is never a property of the message globally.
Custom View Slots
The empty, error and loading states are not view slots on this component. Restyle them through
style.emptyStateStyle and style.errorStateStyle instead — see Styling.
ItemView
Replace the whole row. The default row is a conversation row — avatar, source conversation name, and a one-line preview — so a replacement usually wants the same three pieces.Common Patterns
A saved-messages tab
Because the list is account-wide, a tab or drawer entry is the natural home for it.Read-only list
A custom title and close icon
Styling
The component uses the theme system fromCometChatThemeProvider. Pass a style prop to customize the appearance. Every default value resolves from a semantic theme token, so retheming the kit restyles this panel without touching it.
SavedMessagesStyle deliberately has no itemStyle. The rows are conversation rows and take
their chrome from theme.conversationStyles.itemStyle — the same tokens the conversation list
uses — so the two surfaces cannot drift apart. Restyle the rows there and both update together.Style Properties
Props
All props are optional. There is deliberately nouser or group prop — see Minimal Render.
limit
Page size for the fetch.
The server rejects a value above 100.
onBack
Called when the back affordance is pressed.onItemPress
Called when a row is pressed.source identifies which conversation the message belongs to.
The
source fields are listed under Callback Props.
hideUnsaveMessageOption
Hides Unsave in the row’s long-press menu.ItemView
Replaces the default row entirely.title
Panel title.style
Per-instance style overrides, merged over the theme’ssavedMessagesStyles.
See Styling.
Next Steps
Pinned Messages
The conversation-wide, everyone-sees-it counterpart
Message List
Where the Save option is raised
Save A Message (SDK)
The SDK methods underneath this component
Events
Every UI Kit event, in one place