AI Integration Quick Reference
AI Integration Quick Reference
Overview
CometChatVoiceNoteBubble renders audio messages that were recorded via the composer’s voice recorder. It is a thin wrapper around CometChatAudioBubble, providing the same waveform playback UI.
This bubble renders when enableMultipleAttachments is true (the default in v7) and the audio message carries audioType: "voice_note" in its metadata. Voice notes are always standalone — they never participate in batch grid layouts or multi-attachment grouping.
Routing logic. The audio plugin automatically routes messages based on metadata:
audioType: "voice_note"→CometChatVoiceNoteBubble(this component)- No
audioType(attached audio files) → CometChatAudiosBubble enableMultipleAttachments: false→ legacy CometChatAudioBubble for all audio
- Waveform playback — play/pause, seekable progress bar, elapsed/total time
- Always standalone —
batchPositionis always'single'; voice notes are never grouped with other messages - Metadata-driven — only used when the message has
audioType: "voice_note"in metadata - Delegates to CometChatAudioBubble — inherits its styling and CSS selectors
Usage
How Voice Notes Are Tagged
When a user records audio via the composer’s voice recorder, the UIKit stampsaudioType: "voice_note" into the message metadata before sending:
Props
message
The audio message (voice note). The bubble delegates rendering toCometChatAudioBubble. Required.
| Type | CometChat.MediaMessage |
| Required | Yes |
alignment
Override incoming/outgoing alignment. Defaults to sender-vs-logged-in-user.| Type | "left" | "right" |
| Default | derived |
textFormatters
Text formatters applied to any caption.| Type | CometChatTextFormatter[] |
| Default | undefined |
batchPosition
Batch position. Always'single' for voice notes — they never participate in grid layouts.
| Type | "first" | "middle" | "last" | "single" |
| Default | undefined |
className
Additional CSS class applied to the root element.| Type | string |
| Default | undefined |
CSS Selectors
CometChatVoiceNoteBubble delegates to CometChatAudioBubble — it uses the same CSS selectors:
| Target | Selector |
|---|---|
| Root | .cometchat-audio-bubble |
| Sender / receiver | .cometchat-audio-bubble--sender / .cometchat-audio-bubble--receiver |
| Play button | .cometchat-audio-bubble__play-button |
| Pause button | .cometchat-audio-bubble__pause-button |
| Progress (foreground) | .cometchat-audio-bubble__progress-fg |
| Time | .cometchat-audio-bubble__time |
| Download button | .cometchat-audio-bubble__download-button |
| Caption | .cometchat-audio-bubble__caption |
Next Steps
Audios Bubble
Multi-attachment audio file bubble (non-voice-notes)
Audio Bubble (Legacy)
Legacy single-attachment audio bubble
Message Composer
Voice recorder and multi-attachment staging
Images Bubble
Multi-attachment image bubble