Skip to main content

Overview

CometChatAudiosBubble renders audio file attachment(s) as stacked playback cards. It is self-extracting: pass the SDK message and the bubble derives the audio attachments and caption itself. The message list uses it automatically for audio messages that do not carry the audioType: "voice_note" metadata tag (voice notes render as a Voice Note Bubble instead).
Audio files vs Voice notes. The audio plugin routes messages by the audioType metadata key:
  • No audioType (attached audio files) → CometChatAudiosBubble (this component)
  • audioType: "voice_note" (recorded via voice recorder) → Voice Note Bubble
This distinction is automatic — you don’t need to configure it.
Key capabilities:
  • Stacked audio cards — one card per audio attachment with filename, play/pause, seekable slider, elapsed/total time
  • Inline playback — plays audio directly in the bubble without a fullscreen viewer
  • Download button — download individual audio files
  • Batch grouping — rendered as one connected group when several media messages are sent together (handled by the message list)
  • Caption support — optional caption rendered below the cards
Live Preview — interact with the audio bubble.Open in Storybook ↗

Usage


Audio Card Layout

Each attachment renders as a card with: When a message has multiple audio attachments, cards stack vertically.

Props

message

The audio message. The bubble extracts its attachments and caption from it. Required.

alignment

Override incoming/outgoing alignment. Defaults to sender-vs-logged-in-user.

textFormatters

Text formatters applied to the caption (mentions, URLs).

className

Additional CSS class applied to the root element.

CSS Selectors


Next Steps

Voice Note Bubble

Waveform bubble for recorded voice notes

File Bubble

Batch-aware file bubble with stacked cards

Message List

Multi-attachment batch grouping in the list

Message Composer

Multi-attachment staging tray