Support widget — Chat block
Prochat-support-widget · for record, app pages
Support widget
A support entry point on a page: an invitation, the people who answer, chat and knowledge-base buttons
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-support-widgetUsage
Its demo data, shortened (Using blocks).
<script setup lang="ts">
import ChatSupportWidget from '@/components/trame/blocks/chat/chat-support-widget.vue'
const props = {
title: "Conversation",
options: {
widgetText: "Got a question? We’ll answer.",
team: [
{
name: "Nadia Benali",
role: "Support"
},
{
name: "Theo Garnier",
role: "Support"
}
],
online: true,
onlineLabel: "The team is online",
chat: "chat",
chatLabel: "Chat",
help: "help",
helpLabel: "Knowledge base"
}
}
</script>
<template>
<ChatSupportWidget v-bind="props" />
</template>Props
Each prop says who changes it: Words, Picture, Action, Design, Data.* required.
| Prop | Type | Description |
|---|---|---|
| title* | string | Wordswhat the card is for, read by screen readers ("Exchanges") |
| options* | Options | the block’s settings: layout choices and secondary words, read by every variant |
Options options · 9 props
| Prop | Type | Description |
|---|---|---|
| widgetText | string | Wordsthe invitation ("A question? We will answer.") |
| team | Team[] | the people who answer |
| online | boolean | the host says the team is online now |
| onlineLabel | string | Wordsthe line shown when the team is online ("The team is online") |
| chat* | string | Actionopens the chat |
| chatLabel | string | Wordsthe chat button |
| help | string | Actionopens the knowledge base |
| helpLabel | string | Wordsthe knowledge-base button |
| mood | 'inverse' | 'brand' | 'warm' | 'tint' | string | a band of the page that redefines the theme surfaces inside it |
Team options.team[] · 3 props
| Prop | Type | Description |
|---|---|---|
| name* | string | Wordsthe person’s name |
| avatar | string | Picturea picture: a root-relative path (/media/…) or an absolute URL |
| role | string | Wordstheir role or job title |
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:
options.chat,options.help
A chat section, for record, app pages; it uses @lucide/vue, class-variance-authority, clsx, motion, reka-ui, tailwind-merge.
Built with
The components this block is made of; each one installs on its own too.
More chat blocks
- 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.
- 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.
- 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.