Skip to main content

Built-in message types

All registered automatically by importing @chativa/ui.

typeComponentdata shape
textDefaultTextMessage{ text: string } — Markdown via marked.
imageImageMessage{ src: string, alt?: string, caption?: string }
cardCardMessage{ title: string, subtitle?: string, image?: string, buttons?: MessageAction[] }
buttonsButtonsMessage{ buttons: MessageAction[] }
quick-replyQuickReplyMessage{ actions: MessageAction[], keepActions?: boolean }
carouselCarouselMessage{ cards: { title, image?, actions? }[] }
fileFileMessage{ name, size?, url?, type? }
videoVideoMessage{ src, poster?, caption? }
genuiGenUIMessage{ streamId: string } — see GenUI overview.

MessageAction shape: { label: string, value?: string, url?: string }. See schemas/messages/message-action.schema.json.

Visual reference

TypeScreenshot
texttext message
imageimage message
cardcard message
buttonsbuttons message
quick-replyquick-reply message
carouselcarousel message
filefile message
videovideo message

Screenshots are pending capture from the sandbox.

Examples

text

{ "id": "1", "type": "text", "from": "bot", "data": { "text": "**Hi!**\n\nHow can I help?" } }

card

{
"id": "2",
"type": "card",
"from": "bot",
"data": {
"title": "Pro Plan",
"subtitle": "Best for teams",
"image": "https://example.com/pro.png",
"buttons": [
{ "label": "Choose Pro", "value": "select_pro" },
{ "label": "Learn more", "url": "https://example.com/pro" }
]
}
}

quick-reply

{
"id": "3",
"type": "quick-reply",
"from": "bot",
"data": {
"actions": [
{ "label": "Track my order", "value": "track" },
{ "label": "Talk to a human", "value": "agent" }
]
}
}

keepActions: true — chips stay visible after selection

By default, tapping a chip dispatches chat-action and the chip group disappears (one-time use). Set keepActions: true and the chips remain in the message bubble, with the tapped one rendered as selected (filled with the primary color, prefixed by ✓) and the rest disabled and dimmed:

{
"id": "3",
"type": "quick-reply",
"from": "bot",
"data": {
"keepActions": true,
"actions": [
{ "label": "📦 Track my order", "value": "track_order" },
{ "label": "↩️ Returns & refunds", "value": "returns" },
{ "label": "💬 Talk to a human", "value": "human" }
]
}
}

Pressing the chip still fires chat-action and sends the message — keepActions only changes the visual persistence of the chip group, not the action behaviour.

{
"id": "4",
"type": "carousel",
"from": "bot",
"data": {
"cards": [
{ "title": "Card A", "image": "https://example.com/a.png", "actions": [...] },
{ "title": "Card B", "image": "https://example.com/b.png", "actions": [...] }
]
}
}