ChatBox
DomainFloating chat widget that anchors to the bottom-right of the screen. Includes a FAB toggle, collapsible panel, scrollable message list with typing indicator, and an auto-growing textarea input.
<%- include('modules/domain/common/chat/ChatBox', {
open: true,
title: 'Support Chat',
subtitle: 'We typically reply in a few minutes',
messages: [
{ id: 'm1', role: 'agent', text: 'Hi there! How can I help you today?' },
{ id: 'm2', role: 'user', text: 'I have a question about my order.' }
]
}) %>
<%- include('modules/domain/common/chat/ChatBox', {
open: true,
title: 'Sales Chat',
subtitle: 'Ask us anything',
messages: []
}) %>
<%
var _title = locals.title || 'Support Chat';
var _subtitle = locals.subtitle || 'We typically reply in a few minutes';
var _placeholder = locals.placeholder || 'Type a message…';
var _messages = locals.messages || [];
var _open = locals.open !== undefined ? !!locals.open : false;
var _minimised = !!locals.minimised;
var _id = locals.id || ('chatbox-' + Math.random().toString(36).slice(2, 9));
var _className = locals.className || '';
var panelHeightClass = _minimised ? 'h-14' : 'h-[480px]';
%>