Skip to main content

Message Templates

@asgard-js/react ships with 10 built-in message template types, plus Math (LaTeX) and References (RAG citations) as extended renderers. Select a template below to see how it renders inside the chatbot panel.

Select Template

Click a template type to see how it renders.

Loading chatbot...

Code Example

import { Chatbot } from "@asgard-js/react";
import { createTextTemplateExample } from "./mocks/messages";

export function Demo() {
return (
<Chatbot
title="Text Template Demo"
config={{ botProviderEndpoint: "skip" }}
customChannelId="templates-demo"
initMessages={[createTextTemplateExample()]}
/>
);
}

Supported Templates

Each template's full schema lives in the Message Template section of the Asgard developer docs.

TemplateDescriptionDocs
textPlain or rich text messages with optional quick repliesText
hintContextual hint bubblesHint
buttonInline action buttons (uri, message, emit)Button
carouselSwipeable card carouselCarousel
imageImage with captionImage
audioAudio player
videoVideo player (supports YouTube embeds)
locationGoogle Maps card
chartVega-lite chart rendering
tableStructured tabular data
mathLaTeX-style math formulas (inside a text template via $...$ / $$...$$)
referencesRAG citation sources (shared field across all templates)

Buttons in button and carousel templates fire one of three actions:

ActionBehaviorDocs
messageSend a message to the botAction Object - Message
uriOpen an external linkAction Object - URI
emitTriggers the onTemplateBtnClick callback on <Chatbot> — see the Events demoAction Object - EMIT

Common Fields

All templates share the following fields:

FieldDocs
quickRepliesCommon Features - quickReplies
Rich text (Markdown / lists / tables / LaTeX)Common Features - Text
referencesRAG citations, appended below the message (see table above)