Angular UI Components Documentation
The Angular Chat is a chat UI with a message list, a typing indicator, attachments and AI assistant integration. This guide adds the Angular Chat (jqxChat) to an app, then shows how to set its options, handle its events and call its methods.
jqwidgets-ngjqwidgets-ng/jqxchat 
In an Angular project (to start one, see Getting started with Angular), add the package with the Angular CLI. It asks for a theme and adds the styles to angular.json:
ng add jqwidgets-ng
Components are standalone: add jqxChatModule to the imports of the component that uses it.
import { Component } from '@angular/core';
import { jqxChatModule } from 'jqwidgets-ng/jqxchat';
@Component({
selector: 'app-root',
imports: [jqxChatModule],
templateUrl: './app.html'
})
export class App {}
The source of the live Default Functionality demo.
<jqxChat [width]="440" [height]="600" [colorScheme]="'auto'" [accentColor]="'#6366f1'"
[title]="'AI Assistant'" [subtitle]="'Powered by Claude'"
[provider]="'anthropic'" [model]="'claude-opus-4-8'" [maxTokens]="1024" [stream]="true"
[welcomeMessage]="'Hi! This demo runs offline - set an apiKey or proxyUrl to go live, then ask me anything.'"
[starterPrompts]="prompts" [sendRequest]="sendRequest">
</jqxChat>
import { Component } from '@angular/core';
import { CommonModule } from '@angular/common';
import { jqxChatModule } from 'jqwidgets-ng/jqxchat';
/* Shared offline reply used by the chat demos so they run without an API key. */
function mockReply(t: string): string {
const q = (t || '').toLowerCase();
if (/jqwidgets|jqx|widget|component/.test(q)) {
return '**jQWidgets** ships 80+ UI components for jQuery, Angular, React, Vue and Web Components - grids, charts, schedulers, and this **jqxChat** assistant.';
}
if (/code|example|snippet|function/.test(q)) {
return "Here is a small example:\n\n```js\nfunction greet(name) {\n return 'Hello, ' + name;\n}\ngreet('jQWidgets');\n```";
}
if (/markdown|format|bold|link/.test(q)) {
return 'I render lightweight Markdown safely: **bold**, *italic*, `inline code`, fenced blocks and [links](https://www.jqwidgets.com).';
}
if (/stream/.test(q)) {
return 'With **stream: true** I render tokens as they arrive via appendDelta(), so answers appear word by word.';
}
if (/theme|dark|light|style|brand|color/.test(q)) {
return 'jqxChat inherits the active theme. Set **colorScheme** to `light`, `dark` or `auto`, and **accentColor** to any CSS color.';
}
return (
'You said: "' +
t +
'". Offline I echo you back; set an apiKey or proxyUrl and I stream a real answer here.'
);
}
@Component({
imports: [CommonModule, jqxChatModule],
selector: 'app-root',
templateUrl: './app.html'
})
export class App {
prompts: string[] = [
'What is jQWidgets?',
'Show me a code example',
'Explain streaming responses'
];
sendRequest = (payload: any): Promise<string> => {
const msgs = payload && payload.messages ? payload.messages : [];
const text = msgs.length ? String(msgs[msgs.length - 1].content || '') : '';
return new Promise<string>((resolve) => setTimeout(() => resolve(mockReply(text)), 450));
};
}
Options are inputs, bound with [name]="value".
Events are outputs named on plus the event name with a capital first letter. For example, open: This event is triggered when the popup panel is opened.
<jqxChat (onOpen)="onOpen($event)"></jqxChat>
onOpen(event: any): void {
console.log(event.args);
}
Get the component with a signal query and call its methods. For example, val: Returns the conversation history as an array of message objects (alias of getMessages).
<jqxChat #myChat></jqxChat>
import { Component, viewChild } from '@angular/core';
import { jqxChatModule, jqxChatComponent } from 'jqwidgets-ng/jqxchat';
@Component({
selector: 'app-root',
imports: [jqxChatModule],
templateUrl: './app.html'
})
export class App {
readonly myChat = viewChild.required<jqxChatComponent>('myChat');
run(): void {
const value = this.myChat().val();
console.log(value);
}
}