render
type RenderTemplate = "blocks" | "cards" | "bubbles" | "flow";
The render
property controls the visual template used to render messages in the chat widget. The default value is blocks
.
Example of usage:
const chat = new ChatBot(node, { render: "blocks" });
Render messages in chat with "blocks" template
const chat = new ChatBot(node, { render: "blocks" });
Render messages in chat with "cards" template
const chat = new ChatBot(node, { render: "cards" });
Render messages in chat with "bubbles" template
const chat = new ChatBot(node, { render: "bubbles" });
Render messages in chat with "flow" template
const chat = new ChatBot(node, { render: "flow" });
How to render messages in chat with "blocks" template
chat.setConfig({ render: "blocks" });
How to render messages in chat with "cards" template
chat.setConfig({ render: "cards" });
How to render messages in chat with "bubbles" template
chat.setConfig({ render: "bubbles" });
How to render messages in chat with "flow" template
chat.setConfig({ render: "flow" });
How to get current state of render template in chat
const renderTemplate = chat.getConfig().render;