-
AI-powered Extensions
-
Data Grid
-
Tree List
-
Chat
-
HTML Editor
-
Form
-
-
Data Grids / Data Management
-
Data Grid
- Overview
-
Data Binding
-
Filtering
- Sorting
-
Editing
-
Grouping
-
Selection
- Focused Row
- Paging
-
Scrolling
-
Columns
- AI Assistant
-
Master-Detail
-
Data Summaries
-
Drag & Drop
-
Export to PDF
-
Export to Excel
- Appearance
-
Customization
- State Persistence
-
Adaptability
-
Keyboard Navigation
- Right-To-Left Support
-
Tree List
- Overview
-
Data Binding
-
Filtering
- Sorting
-
Editing
-
Selection
- Focused Row
- Paging
-
Columns
- Drag & Drop
- State Persistence
- Adaptability
-
Keyboard Navigation
-
Card View
-
Pivot Grid
- Overview
-
Data Binding
-
Field Management
-
Data Summaries
- Drill Down
- Filtering
-
Scrolling
-
Export to Excel
- Chart Integration
- Customization
- State Persistence
-
Filter Builder
-
-
Data Visualization
-
Charts
- Overview
-
Data Binding
-
Common Concepts
-
Axis
-
Aggregation
-
Tooltips
-
Selection
-
Customization
-
Zooming
-
Export
-
-
Area Charts
-
Bar Charts
- Bullet Charts
-
Doughnut Charts
-
Financial Charts
-
Funnel and Pyramid Charts
-
Line Charts
- Pareto Chart
-
Pie Charts
-
Point Charts
-
Polar and Radar Charts
-
Range Charts
- Sankey Chart
-
Sparkline Charts
-
Tree Map
-
Gauges
- Overview
-
Runtime update
-
Bar Gauge
-
Circular Gauge
-
Linear Gauge
-
Diagram
- Overview
-
Data Binding
-
Featured Shapes
-
Custom Shapes
-
Document Capabilities
-
User Interaction
- UI Customization
- Adaptability
-
-
Scheduling / Planning
-
Scheduler
- Overview
-
Data Binding
-
Views
-
Appointments
-
Timetable
- Editing
-
Grouping
- Virtual Scrolling
- Drag & Drop
-
Customization
- Adaptability
-
Gantt
- Overview
- Data Binding
-
Filtering
- Sorting
- Strip Lines
- Export to PDF
- Validation
-
Customization
-
-
Messaging
-
WYSIWYG Editor
-
Forms
-
Data Editors
- Overview
-
Common Concepts
-
Calendar
- Check Box
- Color Box
-
Date Box
-
Date Range Box
-
Number Box
- Radio Group
-
Range Selector
- Range Slider
- Slider
- Switch
- Text Area
- Text Box
-
Drop-Downs
- Autocomplete
-
Drop Down Box
-
Select Box
-
Tag Box
-
Lookup
-
Buttons
-
File Upload / File Management
-
File Manager
- Overview
-
File System Types
-
Customization
-
File Uploader
-
-
Popup and Notifications
-
Navigation
- Overview
- Accordion
-
Action Sheet
-
Context Menu
-
Menu
- Multi View
-
Drawer
-
Tab Panel
-
Tabs
-
Toolbar
-
Stepper
- Pagination
-
List
-
Tree View
- Right-to-Left Support
-
Layout
-
Tile View
- Splitter
-
Gallery
- Scroll View
- Box
- Responsive Box
-
-
Interactive Wrappers
-
Sortable
- Resizable
-
-
Progress Indicators
-
Maps
- Overview
-
Map
-
Vector Map
-
Data Binding
- Multiple Layers
-
Markers
- Legend
-
Zooming and Panning
-
Customization
-
-
Localization
Related Demos:
Your search did not match any results.
Angular Chat - Customization
Use the following properties to customize the DevExtreme Chat component:
-
To display/hide Chat UI elements:
-
To modify date/time formats:
-
To deactivate Chat, use the disabled property.
Backend API
<div class="demo-container">
<div class="chat-container">
<dx-chat
#chat
[height]="710"
[user]="currentUser"
[items]="messages$ | async"
[showAvatar]="true"
[showUserName]="true"
[showDayHeaders]="true"
[showMessageTimestamp]="true"
[dayHeaderFormat]="dayHeaderFormats[0]"
[messageTimestampFormat]="messageTimestampFormats[0]"
[disabled]="false"
(onMessageEntered)="onMessageEntered($event)"
>
</dx-chat>
</div>
<div class="options">
<div class="caption">Options</div>
<div class="option">
<dx-check-box text="Avatar" [(value)]="chat.showAvatar"></dx-check-box>
</div>
<div class="option">
<dx-check-box
text="User Name"
[(value)]="chat.showUserName"
></dx-check-box>
</div>
<div class="option-separator"></div>
<div class="option">
<dx-check-box
text="Day Headers"
[(value)]="chat.showDayHeaders"
></dx-check-box>
</div>
<div class="option">
<span>Day Header Format:</span>
<dx-select-box
[items]="dayHeaderFormats"
[(value)]="chat.dayHeaderFormat"
[inputAttr]="dayHeaderLabel"
></dx-select-box>
</div>
<div class="option-separator"></div>
<div class="option">
<dx-check-box
text="Message Timestamp"
[(value)]="chat.showMessageTimestamp"
></dx-check-box>
</div>
<div class="option">
<span>Message Timestamp Format:</span>
<dx-select-box
[items]="messageTimestampFormats"
[(value)]="chat.messageTimestampFormat"
[inputAttr]="messageTimestampLabel"
></dx-select-box>
</div>
<div class="option-separator"></div>
<div class="option">
<dx-check-box
text="Disable Chat"
[(value)]="chat.disabled"
></dx-check-box>
</div>
</div>
</div>
import { bootstrapApplication } from '@angular/platform-browser';
import { Component, enableProdMode, provideZoneChangeDetection } from '@angular/core';
import { AsyncPipe } from '@angular/common';
import { DxChatModule, DxCheckBoxModule, DxSelectBoxModule } from 'devextreme-angular';
import { DxChatTypes } from 'devextreme-angular/ui/chat';
import { Observable } from 'rxjs';
import { AppService } from './app.service';
if (!/localhost/.test(document.location.host)) {
enableProdMode();
}
@Component({
selector: 'demo-app',
templateUrl: './app.component.html',
styleUrls: ['./app.component.css'],
imports: [
DxChatModule,
DxCheckBoxModule,
DxSelectBoxModule,
AsyncPipe,
],
})
export class AppComponent {
currentUser: DxChatTypes.User;
supportAgent: DxChatTypes.User;
messages$: Observable<DxChatTypes.Message[]>;
dayHeaderFormats = this.appService.dayHeaderFormats;
messageTimestampFormats = this.appService.messageTimestampFormats;
dayHeaderLabel = this.appService.dayHeaderLabel;
messageTimestampLabel = this.appService.messageTimestampLabel;
constructor(private readonly appService: AppService) {
[this.currentUser, this.supportAgent] = this.appService.getUsers();
this.messages$ = this.appService.messages$;
}
onMessageEntered(event: DxChatTypes.MessageEnteredEvent) {
this.appService.onMessageEntered(event);
}
}
bootstrapApplication(AppComponent, {
providers: [
provideZoneChangeDetection({ eventCoalescing: true, runCoalescing: true }),
AppService,
],
});
.demo-container {
min-width: 720px;
display: flex;
gap: 20px;
}
::ng-deep .chat-container {
display: flex;
flex-grow: 1;
align-items: center;
justify-content: center;
}
::ng-deep .options {
padding: 20px;
display: flex;
flex-direction: column;
min-width: 280px;
background-color: rgba(191, 191, 191, 0.15);
gap: 16px;
}
::ng-deep .dx-chat {
max-width: 480px;
}
::ng-deep .caption {
font-size: var(--dx-font-size-sm);
font-weight: 500;
}
::ng-deep .option-separator {
border-bottom: 1px solid var(--dx-color-border);
}
::ng-deep .dx-avatar {
border: 1px solid var(--dx-color-border);
}
import { Injectable } from '@angular/core';
import { Observable, BehaviorSubject } from 'rxjs';
import { DxChatTypes } from 'devextreme-angular/ui/chat';
@Injectable({
providedIn: 'root',
})
export class AppService {
date: Date;
currentUser: DxChatTypes.User = {
id: 'c94c0e76-fb49-4b9b-8f07-9f93ed93b4f3',
name: 'John Doe',
};
supportAgent: DxChatTypes.User = {
id: 'd16d1a4c-5c67-4e20-b70e-2991c22747c3',
name: 'Support Agent',
avatarUrl: '../../../../images/petersmith.png',
};
dayHeaderFormats = ['dd/MM/yyyy', 'dd.MM.yyyy', 'MMMM dd, yyyy', 'EEEE, MMMM dd'];
messageTimestampFormats = ['hh:mm a', 'hh:mm:ss a', 'HH:mm', 'HH:mm:ss'];
messageTimestampLabel = { 'aria-label': 'Message Timestamp Format' };
dayHeaderLabel = { 'aria-label': 'Day Header Format' };
messages: DxChatTypes.Message[] = [];
messagesSubject: BehaviorSubject<DxChatTypes.Message[]> = new BehaviorSubject([]);
constructor() {
this.date = new Date();
this.date.setHours(0, 0, 0, 0);
this.messages = [
{
timestamp: this.getTimestamp(this.date, -9),
author: this.supportAgent,
text: 'Hello, John!\nHow can I assist you today?',
},
{
timestamp: this.getTimestamp(this.date, -7),
author: this.currentUser,
text: 'Hi, I\'m having trouble accessing my account.',
},
{
timestamp: this.getTimestamp(this.date, -7),
author: this.currentUser,
text: 'It says my password is incorrect.',
},
{
timestamp: this.getTimestamp(this.date, -7),
author: this.supportAgent,
text: 'I can help you with that. Can you please confirm your UserID for security purposes?',
},
{
timestamp: this.getTimestamp(this.date, 1),
author: this.currentUser,
text: 'john.doe1357',
},
{
timestamp: this.getTimestamp(this.date, 1),
author: this.supportAgent,
text: '✅ Instructions to restore access have been sent to the email address associated with your account.',
},
];
this.messagesSubject.next(this.messages);
}
get messages$(): Observable<DxChatTypes.Message[]> {
return this.messagesSubject.asObservable();
}
getUsers(): DxChatTypes.User[] {
return [this.currentUser, this.supportAgent];
}
getTimestamp(date: Date, offsetMinutes = 0): number {
return date.getTime() + offsetMinutes * 60000;
}
onMessageEntered(event: DxChatTypes.MessageEnteredEvent) {
this.messages = [...this.messages, event.message];
this.messagesSubject.next(this.messages);
}
}
<!DOCTYPE html>
<html lang="en">
<head>
<title>DevExtreme Demo</title>
<meta http-equiv="X-UA-Compatible" content="IE=edge" />
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=5.0" />
<link rel="stylesheet" type="text/css" href="https://cdn3.devexpress.com/jslib/26.1.5/css/dx.light.css" />
</head>
<body class="dx-viewport">
<div class="demo-container">
<demo-app>Loading...</demo-app>
</div>
<script src="https://cdn.jsdelivr.net/npm/zone.js@0.16.2/bundles/zone.umd.js"></script>
<script src="./bundle.js" type="module"></script>
</body>
</html>