Floating AI assistant

Look at the bottom-right corner - a launcher button floats above the page. Click it to open the assistant panel; click the panel's x to collapse it back to the button.

This is the classic "support bubble" pattern, built entirely with jqxChat in popup mode.

jQuery Chat: Floating

jqxChat popup mode: a floating launcher button opens the AI assistant panel.

A live JavaScript/jQuery example of jqxChat, the jQWidgets Chat component, with its complete source code below. It is one of 5 jqxChat demos for jQuery.

jqxChat API used in this demo

Source code

To run it in your own page, load jqx.base.css, a theme and the library files below from npm (npm install jqwidgets-scripts) or the jsDelivr CDN, then add the markup and the script. jQuery is not required: jqxcore.js provides $.

The page loads jqx.base.css, a theme and these library files: jqxcore.js, jqxbuttons.js, jqxchat.js.

It also loads helper scripts of this demo site, which are not part of the library: demos.js (getWidth() and other layout helpers), mockassistant.js.

script.js

$(document).ready(function () {
    // mode: 'popup' renders a floating launcher button in the corner.
    // Clicking it toggles the chat panel. In a real app set apiKey / proxyUrl
    // instead of sendRequest.
    $('#chat').jqxChat({
        colorScheme: 'auto',
        theme: 'light',
        mode: 'popup',
        launcherPosition: 'bottom-right',
        width: 380,
        height: 560,
        title: 'Help Assistant',
        subtitle: 'Ask us anything',
        welcomeMessage: 'Hi! How can we help you today?',
        starterPrompts: ['What is jQWidgets?', 'How do I get support?'],
        sendRequest: jqxChatMock
    });

    // you can also drive the popup programmatically:
    $('#openBtn').jqxButton({ theme: 'light', width: 150, height: 30 });
    $('#openBtn').on('click', function () { $('#chat').jqxChat('toggle'); });
});

body.html

<div class="page">
    <h2>Floating AI assistant</h2>
    <p>
        Look at the <strong>bottom-right corner</strong> - a launcher button floats above the page.
        Click it to open the assistant panel; click the panel's <em>x</em> to collapse it back to the button.
    </p>
    <p>This is the classic "support bubble" pattern, built entirely with <code>jqxChat</code> in popup mode.</p>
    <p><input type="button" id="openBtn" value="Toggle from code"></p>
</div>

<div id="chat"></div>

More jQuery Chat demos