Skip to content

Chat Message ​

A single chat message bubble for building chat interfaces and messaging UIs.

Basic ​

Received (left) and sent (right) messages.

Alice
Alice
Hey! How's the project going?10:00 AM
Going great! Almost done with the components.
Just finishing up the chat message component.10:02 AM
Alice
Alice
Awesome, can't wait to see it!10:03 AM
I'll share a preview tonight.10:04 AM
vue
<VxChatMessage
  name="Alice"
  content="Hey! How's the project going?"
  time="10:00 AM"
  avatar="avatar.jpg"
/>
<!-- Auto-grouped: same time + same sender = grouped -->
<VxChatMessage sent content="Going great!" time="10:02 AM" prev-time="10:00 AM" :prev-sent="false" />
<VxChatMessage sent content="Just finishing up." time="10:02 AM" status="read" prev-time="10:02 AM" :prev-sent="true" />

Avatar Fallback ​

When no avatar URL is provided, shows the first letter of name or avatar-text.

B
Bob
Did you push the latest changes?11:00 AM
Yes, just now.11:01 AM
M
B
Bob
Perfect, I'll pull and test.11:02 AM
vue
<VxChatMessage name="Bob" content="Message here" />
<VxChatMessage sent content="Reply" avatar-text="Me" />

No Avatar ​

Hide avatars with :show-avatar="false".

Support
How can I help you today?9:00 AM
I have a question about billing.9:01 AM
vue
<VxChatMessage :show-avatar="false" content="Message" />

Variants ​

Three visual styles: default, outline, and ghost.

Default
A
Alice
Default received style
Default sent style
M
Outline
A
Alice
Outline received style
Outline sent style
M
Ghost
A
Alice
Ghost received style
Ghost sent style
M
vue
<VxChatMessage content="Default" />
<VxChatMessage content="Outline" variant="outline" />
<VxChatMessage content="Ghost" variant="ghost" />

Status ​

Sent messages can show delivery status: sending, sent, delivered, read, or error.

Sending...1:00 PM
M
Message sent1:01 PM
M
Message delivered1:02 PM
M
Message read1:03 PM
M
Failed to send1:04 PM
M
vue
<VxChatMessage sent content="Sending..." status="sending" />
<VxChatMessage sent content="Delivered" status="delivered" />
<VxChatMessage sent content="Read" status="read" />
<VxChatMessage sent content="Failed" status="error" />

Loading (Typing) ​

Show a typing indicator with the loading prop.

Are you there?3:00 PM
M
Alice
Alice
vue
<VxChatMessage name="Alice" avatar="avatar.jpg" loading />

File Attachment ​

Show file messages with upload/download states.

Alice
Alice
project-spec.pdf2.4 MB
2:00 PM
design-v3.fig14.2 MB
Here's the latest design2:01 PM
M
screenshot.pngUploading · 64%...
2:01 PM
M
Alice
Alice
meeting-notes.docxDownloading · 32%...
2:02 PM
Alice
Alice
backup-archive.zip89 MB
2:03 PM
vue
<script setup>
import { reactive } from 'vue'

const file = reactive({
  name: 'archive.zip',
  size: '89 MB',
  status: 'idle',  // 'idle' | 'downloading' | 'uploading' | 'done'
  progress: 0
})

function onDownload(f) {
  f.status = 'downloading'
  f.progress = 0
  const timer = setInterval(() => {
    f.progress = Math.min(f.progress + 10, 100)
    if (f.progress >= 100) {
      clearInterval(timer)
      f.status = 'done'
    }
  }, 200)
}
</script>

<VxChatMessage :file="file" @download="onDownload" />

Slot Content ​

Use the default slot for rich content inside the bubble.

B
Bot
project-spec.pdf
2.4 MB
4:00 PM
Thanks! I'll review it now 👍 4:02 PM
M
vue
<VxChatMessage name="Bot" avatar-text="B">
  <div>Custom rich content here</div>
</VxChatMessage>

<VxChatMessage sent>
  Thanks! I'll review it now 👍
</VxChatMessage>

Use the footer slot for reactions, actions, or any extra content below the bubble.

This new design is fire!5:00 PM
🔥 3👍 2
M
vue
<VxChatMessage sent content="This new design is fire!">
  <template #footer>
    <div style="display: flex; gap: 4px;">
      <span>🔥 3</span>
      <span>👍 2</span>
    </div>
  </template>
</VxChatMessage>

API ​

Props ​

PropTypeDefaultDescription
sentbooleanfalseAlign to right (sent message)
avatarstring''Avatar image URL
avatar-textstring''Avatar fallback text
namestring''Sender name
timestring''Timestamp
contentstring''Message text (or use default slot)
status'sending' | 'sent' | 'delivered' | 'read' | 'error'—Delivery status (shown on sent messages)
variant'default' | 'outline' | 'ghost''default'Visual style
show-avatarbooleantrueShow avatar
loadingbooleanfalseShow typing dots
groupedboolean—Force group with previous message (auto-detected via prev-time/prev-sent)
prev-timestring—Previous message time (auto-groups if same time + same sender)
prev-sentboolean—Previous message sent state (used with prev-time for auto-grouping)
fileChatMessageFile—File attachment { name, size?, status?, progress?, url? }
menuChatMessageMenuItem[] | falsedefault itemsContext menu items (right-click). Pass false to disable
next-timestring—Next message time (used for group position detection)
next-sentboolean—Next message sent state (used for group position)

Events ​

EventDescription
retryEmitted when retry is clicked on error status
actionEmitted when a context menu action is clicked (payload: key, item)
downloadEmitted when a file with idle/done status is clicked

Slots ​

SlotDescription
defaultCustom bubble content
avatarCustom avatar
footerContent below the bubble (reactions, actions)