DevExtreme v26.1 is now available.

Explore our newest features/capabilities and share your thoughts with us.

Your search did not match any results.

Angular Load Indicator

The LoadIndicator component notifies users that a process is in progress. In this demo, you can see how to initialize and configure the component and integrate it into other components.

Backend API
<div class="form"> <div class="label">Custom size</div> <div class="indicators"> <dx-load-indicator id="small-indicator" height="20" width="20" ></dx-load-indicator> <dx-load-indicator id="medium-indicator" height="40" width="40" ></dx-load-indicator> <dx-load-indicator id="large-indicator" height="60" width="60" ></dx-load-indicator> </div> <div class="label">Custom image</div> <dx-load-indicator id="image-indicator" indicatorSrc="../../../../images/Loading.gif" ></dx-load-indicator> <div class="label">Using with other widgets</div> <dx-button id="button" [height]="40" [width]="180" (onClick)="onClick()"> <div *dxTemplate="let data of 'content'"> <dx-load-indicator class="button-indicator" [visible]="loadIndicatorVisible" > </dx-load-indicator> <span class="dx-button-text">{{ buttonText }}</span> </div> </dx-button> </div>
import { bootstrapApplication } from '@angular/platform-browser'; import { ChangeDetectorRef, Component, enableProdMode, provideZoneChangeDetection, } from '@angular/core'; import { DxButtonModule, DxLoadIndicatorModule } from 'devextreme-angular'; if (!/localhost/.test(document.location.host)) { enableProdMode(); } @Component({ selector: 'demo-app', templateUrl: './app.component.html', styleUrls: ['./app.component.css'], imports: [ DxButtonModule, DxLoadIndicatorModule, ], }) export class AppComponent { loadIndicatorVisible = false; buttonText = 'Send'; constructor(private changeDetectorRef: ChangeDetectorRef) {} onClick() { this.buttonText = 'Sending'; this.loadIndicatorVisible = true; setTimeout(() => { this.buttonText = 'Send'; this.loadIndicatorVisible = false; this.changeDetectorRef.detectChanges(); }, 2000); } } bootstrapApplication(AppComponent, { providers: [ provideZoneChangeDetection({ eventCoalescing: true, runCoalescing: true }), ], });
.form { padding: 10px 0 0 10px; } .label { margin-bottom: 10px; font-size: 16px; } .label:not(:first-child) { margin-top: 30px; } #small-indicator, #medium-indicator, #large-indicator { vertical-align: middle; margin-right: 10px; } ::ng-deep #button, ::ng-deep #button .dx-button-content { padding: 0; } #button .button-indicator { height: 32px; width: 32px; display: inline-block; vertical-align: middle; margin-right: 5px; } .indicators { display: flex; align-items: center; }
<!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>

Specify Dimensions

LoadIndicator allows you to specify its dimensions. Set the height and width properties to the size you need. In this demo, the first three components have different sizes.

Apply a Custom Indicator

If you want to apply a custom indicator, assign the path to a new image to the indicatorSrc property. In this demo, the fourth LoadIndicator displays a custom animated GIF.

Integrate LoadIndicator into Other Components

You can use LoadIndicator within other UI components. In this demo, the indicator appears in the Button component when a user clicks the button. To show and hide LoadIndicator, use the visible property.