Angular UI Components Documentation
The Angular ProgressBar visually indicates the progress of a lengthy operation. This guide adds the Angular ProgressBar (jqxProgressBar) to an app, then shows how to set its options, handle its events and call its methods.
jqwidgets-ngjqwidgets-ng/jqxprogressbar 
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 jqxProgressBarModule to the imports of the component that uses it.
import { Component } from '@angular/core';
import { jqxProgressBarModule } from 'jqwidgets-ng/jqxprogressbar';
@Component({
selector: 'app-root',
imports: [jqxProgressBarModule],
templateUrl: './app.html'
})
export class App {}
The source of the live Default Functionality demo.
<div style="font-size: 13px; font-family: Verdana; float: left;">
<div style="margin-top: 10px;">Horizontal</div>
<jqxProgressBar #horizontal
[width]="250" [height]="30" [value]="50">
</jqxProgressBar>
<div style="margin-top: 10px;">Vertical</div>
<jqxProgressBar #vertical
[width]="30" [height]="250" [value]="50" [orientation]="'vertical'">
</jqxProgressBar>
<br />
<div>Enter a value between 0 and 100</div>
<jqxInput #ValueInput></jqxInput>
<!--<input id="ValueInput" type="text" style="margin-top: 5px;" />-->
<jqxButton (onClick)="onClick()">Update</jqxButton>
<jqxCheckBox (onChange)="onCheckBox($event)">
Show Progress Text
</jqxCheckBox>
<jqxCheckBox (onChange)="onCustomTextCheckBox($event)">
Custom Progress Text
</jqxCheckBox>
</div>
import { Component, viewChild } from '@angular/core';
import { jqxProgressBarComponent } from 'jqwidgets-ng/jqxprogressbar';
import { jqxInputComponent } from 'jqwidgets-ng/jqxinput';
import { CommonModule } from '@angular/common';
import { FormsModule } from '@angular/forms';
import { jqxProgressBarModule } from 'jqwidgets-ng/jqxprogressbar';
import { jqxButtonModule } from 'jqwidgets-ng/jqxbuttons';
import { jqxCheckBoxModule } from 'jqwidgets-ng/jqxcheckbox';
import { jqxInputModule } from 'jqwidgets-ng/jqxinput';
@Component({
imports: [
CommonModule,
FormsModule,
jqxProgressBarModule,
jqxButtonModule,
jqxCheckBoxModule,
jqxInputModule
],
selector: 'app-root',
templateUrl: './app.html'
})
export class App {
readonly myHorizontalProgressBar = viewChild.required<jqxProgressBarComponent>('horizontal');
readonly myVerticalProgressBar = viewChild.required<jqxProgressBarComponent>('vertical');
readonly ValueInputElement = viewChild.required<jqxInputComponent>('ValueInput');
valueInput: number | undefined;
isUpdated = false;
renderText(text?: string, value?: number): string {
return (
"<span class='jqx-rc-all' style='background: #ffe8a6; color: #e53d37; font-style: italic;'>" +
text +
'</span>'
);
}
getValueInput(): number {
return parseInt(this.ValueInputElement().val());
}
onClick(): void {
let value = this.getValueInput();
if (!isNaN(value)) {
this.valueInput = value;
this.myHorizontalProgressBar().val(value);
this.myVerticalProgressBar().val(value);
this.isUpdated = true;
}
}
onCheckBox(event: any): void {
let value = this.getValueInput();
if (value != null && this.isUpdated) {
this.myHorizontalProgressBar().value(this.valueInput);
this.myVerticalProgressBar().value(this.valueInput);
}
let isChecked = event.args.checked;
this.myHorizontalProgressBar().showText(isChecked);
this.myVerticalProgressBar().showText(isChecked);
}
onCustomTextCheckBox(event: any): void {
const value = this.getValueInput();
if (value != null && this.isUpdated) {
this.myHorizontalProgressBar().value(this.valueInput);
this.myVerticalProgressBar().value(this.valueInput);
}
if (event.args.checked) {
this.myHorizontalProgressBar().renderText(this.renderText);
this.myVerticalProgressBar().renderText(this.renderText);
} else {
this.myHorizontalProgressBar().renderText(null as any);
this.myVerticalProgressBar().renderText(null as any);
}
}
}Options are inputs, bound with [name]="value".
Events are outputs named on plus the event name with a capital first letter. For example, valueChanged: This event is triggered when the value is changed.
<jqxProgressBar (onValueChanged)="onValueChanged($event)"></jqxProgressBar>
onValueChanged(event: any): void {
console.log(event.args);
}
Get the component with a signal query and call its methods. For example, val: Sets or gets the value.
<jqxProgressBar #myProgressBar></jqxProgressBar>
import { Component, viewChild } from '@angular/core';
import { jqxProgressBarModule, jqxProgressBarComponent } from 'jqwidgets-ng/jqxprogressbar';
@Component({
selector: 'app-root',
imports: [jqxProgressBarModule],
templateUrl: './app.html'
})
export class App {
readonly myProgressBar = viewChild.required<jqxProgressBarComponent>('myProgressBar');
run(): void {
const value = this.myProgressBar().val();
console.log(value);
}
}