{% load static %}
Try out the Unicom WebChat component! Send messages, upload images and audio, create multiple chats, and experience all the features in action.
Click "New Chat" to start a conversation. Try sending text, uploading images or audio files, and switching between multiple chats.
Embed the chat component in your Django templates with just a few lines of code:
{% verbatim %}{% load unicom_tags %}
<!-- Simple single-chat component -->
{% webchat_component %}
<!-- Multi-chat component with sidebar -->
<script type="module" src="https://cdn.jsdelivr.net/npm/lit@3/+esm"></script>
<script type="module" src="{% static 'unicom/webchat/webchat-with-sidebar.js' %}"></script>
<unicom-chat-with-sidebar
theme="light"
auto-refresh="5"
style="height: 700px;">
</unicom-chat-with-sidebar>
<!-- With custom styling -->
<unicom-chat-with-sidebar
theme="dark"
auto-refresh="3"
style="
height: 800px;
--unicom-primary-color: #ff5722;
--unicom-border-radius: 16px;
">
</unicom-chat-with-sidebar>
<!-- WebSocket-only mode (retry on failure, no polling fallback) -->
<unicom-chat-with-sidebar
theme="light"
enable-websocket-only="true"
style="height: 700px;">
</unicom-chat-with-sidebar>{% endverbatim %}