Inbox two pane — Chat block
Prochat-inbox-two-pane · for app, support, messages pages
Inbox two pane
Email-like reading: the list beside the thread, the correspondent’s details in the thread header
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-inbox-two-paneUsage
Its demo data, shortened (Using blocks).
<script setup lang="ts">
import ChatInboxTwoPane from '@/components/trame/blocks/chat/chat-inbox-two-pane.vue'
const props = {
title: "Customer messages",
threads: [
{
id: 1,
from: "Camille Marchand",
subject: "My order hasn’t arrived",
snippet: "Hello, the package was due on Tuesday and I still haven’t received anything…",
time: "9:42 a.m.",
unread: true,
tag: "Delivery"
},
{
id: 2,
from: "Julien Perrot",
subject: "Question about the wool sweater’s size",
snippet: "I’m 6′0″ and 172 lb, which size would you recommend?",
time: "8:15 a.m.",
unread: true
}
],
selected: 1,
messages: [
{
id: "a",
author: "Camille Marchand",
role: "Customer",
at: "Today, 9:42 a.m.",
body: "Hello,\nThe package was due on Tuesday and I still haven’t received anything. Tracking has said “in transit” for four days. Could you check?"
},
{
id: "b",
author: "Helen",
role: "Team",
at: "Today, 9:58 a.m.",
mine: true,
body: "Hi Camille, I’m contacting the carrier and will get back to you later today."
}
],
fields: [
{
label: "Status",
value: "Open",
tone: "info"
},
{
label: "Priority",
value: "High",
tone: "warning"
}
],
open: "thread",
reply: "reply",
note: "note",
options: {
composer: "reply+note"
}
}
</script>
<template>
<ChatInboxTwoPane v-bind="props" />
</template>Props
Each prop says who changes it: Words, Picture, Action, Design, Data.* required.
| Prop | Type | Description |
|---|---|---|
| title* | string | Wordsthe inbox’s heading ("Customer messages") |
| threads* | Thread[] | Datathe conversations, newest first |
| selected | string | number | Datathe id of the open thread; the first one when absent |
| messages | Message[] | Datathe open thread’s messages, oldest first |
| fields | Field[] | the form’s fields, in order |
| open | string | Actionthe page a thread leads to |
| reply | string | Actionwhere a reply is sent |
| note | string | Actionwhere an internal note is sent |
| options | Options | the block’s settings: layout choices and secondary words, read by every variant |
Thread threads[] · 8 props
| Prop | Type | Description |
|---|---|---|
| id* | string | number | the message’s id |
| from* | string | Wordswho wrote last, or the conversation’s correspondent |
| subject* | string | Wordsthe thread’s subject |
| snippet | string | Wordsthe first words of the last message |
| time | string | Wordswhen, as the host writes it ("09:42", "yesterday") |
| unread | boolean | true: the thread has unread messages |
| avatar | string | Picturea picture: a root-relative path (/media/…) or an absolute URL |
| tag | string | Wordsa short label the host set ("Delivery") |
Message messages[] · 7 props
| Prop | Type | Description |
|---|---|---|
| id* | string | number | the message’s id |
| author* | string | Wordswho wrote it |
| role | string | Wordswho the author is ("Customer", "Team") |
| at* | string | Wordswhen, as the host writes it |
| body | string | Wordsthe message itself |
| mine | boolean | written by the person using the app |
| kind | 'message' | 'note' | a note is internal and says so |
Field fields[] · 3 props
| Prop | Type | Description |
|---|---|---|
| label* | string | Wordsthe property’s name ("Status", "Priority", "Assigned to") |
| value* | string | Wordsits value, as the host holds it |
| tone | 'neutral' | 'info' | 'success' | 'warning' | 'danger' | the status colour |
Options options · 3 props
| Prop | Type | Description |
|---|---|---|
| composer | 'reply' | 'reply+note' | 'none' | what the composer offers: a reply, a reply or a note, or nothing |
| empty | string | Wordswhat an empty inbox says |
| mood | 'inverse' | 'brand' | 'warm' | 'tint' | string | a 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).
| Member | What it is for |
|---|---|
| href | the address an action leads to, or null to hide what leads there |
| act | runs a change (subscribe, add to cart, save) and answers { ok } or { ok: false, error } |
| can | whether the page has this action |
| asset | a picture’s address as your app serves it |
| Link | your router’s link component |
| cartCount | the cart badge’s number |
| cartDrawer | whether your app has a cart drawer |
| cartOpen | whether the cart drawer is open |
| label | your 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:
| Key | English | French |
|---|---|---|
| newsletter.already | You are already subscribed. | Vous êtes déjà inscrit. |
| newsletter.done | Done: you are subscribed. | C’est noté : vous êtes inscrit. |
| newsletter.invalid | Check the email address. | Vérifiez l’adresse e-mail. |
| newsletter.tooMany | Too 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:
open,reply,note - Reads
threads,messagesfrom your app
A chat section, for app, support, messages 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 bubbles: a customer conversation on a ticket or an order: two sides, the team dark, notes tinted, reply and note tabs.
- Conversation page sidebar: A full workspace with conversation history beside the host-provided conversation.
- 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.
- Thread flat: comments on a record: everyone left-aligned with avatar and name, an anchor quote, resolve and assign.