Conversation bubbles — Chat block

Pro

chat-conversation-bubbles · for record, app pages

Conversation bubbles

A customer conversation on a ticket or an order: two sides, the team dark, notes tinted, reply and note tabs

Documentation

Installation

One command copies the block into your project with the shadcn CLI (the registry is set once: Installation).

pnpm dlx shadcn-vue@latest add @trame/chat-conversation-bubbles

Usage

Its demo data, shortened (Using blocks).

<script setup lang="ts">
import ChatConversationBubbles from '@/components/trame/blocks/chat/chat-conversation-bubbles.vue'

const props = {
title: "Conversation",
messages: [
{
id: 1,
author: {
name: "System"
},
side: "team",
kind: "system",
at: "Oct 7",
body: "Opened from the contact form · Oct 7"
},
{
id: 2,
author: {
name: "Louis Martin"
},
side: "customer",
at: "Oct 7, 4:40 p.m.",
anchor: "Delivery is expected by October 6 at the latest.",
body: "Hello, my order 2041 was supposed to arrive yesterday and I still haven’t received anything. Could you look into it?"
}
],
viewer: {
name: "Nadia Benali"
},
reply: "reply",
note: "note",
options: {
canNote: true,
shortcutHint: "Ctrl + Enter to send"
}
}
</script>

<template>
<ChatConversationBubbles v-bind="props" />
</template>

Props

Each prop says who changes it: Words, Picture, Action, Design, Data.* required.

PropTypeDescription
title*stringWordsthe conversation’s heading ("Exchanges")
messages*Message[]Datathe messages, oldest first
viewerViewerDatathe person looking at the thread, for the composer
reply*stringActionthe page action that sends a reply
notestringActionthe page action that saves an internal note
optionsOptionsthe block’s settings: layout choices and secondary words, read by every variant
Message messages[] · 11 props
PropTypeDescription
id*string | numberthe message’s id
author*Authorwho wrote it
side*'customer' | 'team'who wrote it: the person the thread is about, or the team
kind'message' | 'note' | 'system'note: internal, never seen by the customer; system: a line of the record’s history
at*stringWordswhen, as the app writes it ("9 Oct., 14:32"): never computed here
bodystringWordsthe text; absent shows a placeholder
aibooleanwritten by an assistant: labelled as such
attachmentsAttachment[]files attached to the message
anchorstringWordsflat: the passage this comment is about
resolvedbooleantrue: the thread is resolved
outdatedbooleanthe passage changed since this comment
Author messages[].author · 3 props
PropTypeDescription
name*stringWordsthe person’s name
avatarstringPicturea picture: a root-relative path (/media/…) or an absolute URL
rolestringWordstheir role or job title
Attachment messages[].attachments[] · 2 props
PropTypeDescription
name*stringWordsthe file’s name
sizestringWordsits size, as the app writes it
Viewer viewer · 2 props
PropTypeDescription
name*stringWordsthe person’s name
avatarstringPicturea picture: a root-relative path (/media/…) or an absolute URL
Options options · 5 props
PropTypeDescription
canNotebooleanthis viewer may leave internal notes
shortcutHintstringWordshow to send from the keyboard ("Ctrl + Enter to send")
placeholderstringWordsthe composer’s placeholder
pageSizenumbermessages shown before "Older messages"
mood'inverse' | 'brand' | 'warm' | 'tint' | stringa band of the page that redefines the theme surfaces inside it
What it asks your app for

The block never knows your app: it asks it, through one context provided once, where its links lead, what its actions do, how a price reads and which words to say (The host context).

MemberWhat it is for
hrefthe address an action leads to, or null to hide what leads there
actruns a change (subscribe, add to cart, save) and answers { ok } or { ok: false, error }
canwhether the page has this action
asseta picture’s address as your app serves it
cartCountthe cart badge’s number
cartDrawerwhether your app has a cart drawer
cartOpenwhether the cart drawer is open
labelyour word for an interface key, or undefined to keep the block’s own

The words it says itself, in English and French; label(key) replaces any of them:

KeyEnglishFrench
newsletter.alreadyYou are already subscribed.Vous êtes déjà inscrit.
newsletter.doneDone: you are subscribed.C’est noté : vous êtes inscrit.
newsletter.invalidCheck the email address.Vérifiez l’adresse e-mail.
newsletter.tooManyToo many attempts, try again in a moment.Trop de tentatives, réessayez dans un moment.

Features

  • Every word in the server HTML
  • Same markup in Vue and React
  • Theme tokens only: every theme, light and dark
  • Shows what you give it, invents nothing
  • No motion; still under reduced motion
  • Real buttons and links, a visible focus
  • Asks your app through actions: reply, note
  • Reads messages from your app

A chat section, for record, app pages; it uses @lucide/vue, @vueuse/core, class-variance-authority, clsx, reka-ui, tailwind-merge.

Built with

The components this block is made of; each one installs on its own too.

More chat blocks

  • Assistant inline: A single answer card inside a record page, with earlier context kept in an open disclosure.
  • Assistant panel: A narrow companion panel with sourced answers and follow-up prompts supplied by the host.
  • Conversation page sidebar: A full workspace with conversation history beside the host-provided conversation.
  • Inbox three pane: triage support tickets or messages on a wide screen: the list, the thread and its properties side by side.
  • Inbox two pane: email-like reading: the list beside the thread, the correspondent’s details in the thread header.
  • Message digest sections: an app-home widget: threads grouped in labelled sections with their unread counts, no reading pane.
  • Support widget: a support entry point on a page: an invitation, the people who answer, chat and knowledge-base buttons.
  • Thread correspondence: A spacious message ledger beside a separate writing desk for sustained replies to the merchant’s own conversation.

All 10 chat blocks