The ScrollBar component for Angular represents a widget that provides a scroll bar that has a sliding thumb whose position corresponds to a value.
npm install -g @angular/cli ng new jqwidgets-project cd jqwidgets-project
ng add jqwidgets-ng
jQWidgets UI for Angular is distributed as jqwidgets-ng NPM package
npm install jqwidgets-ng
@import 'jqwidgets-ng/jqwidgets/styles/jqx.base.css';
"styles": [ "node_modules/jqwidgets-ng/jqwidgets/styles/jqx.base.css" ]
<div style="margin-bottom: 10px;" #VerticalDiv>Vertical</div>
<jqxScrollBar [theme]="'fluent'" (onValueChanged)="onValueChangedVertical($event)"
[width]="18" [height]="280"
[min]="0" [max]="1000" [vertical]="true">
</jqxScrollBar>
<div style="margin: 10px 0;" #HorizontalDiv>Horizontal</div>
<jqxScrollBar [theme]="'fluent'" (onValueChanged)="onValueChangedHorizontal($event)"
[width]="280" [height]="18"
[min]="0" [max]="1000">
</jqxScrollBar>
import { Component, ViewChild, ElementRef } from '@angular/core';
import { jqxScrollbarModule, jqxScrollbarComponent } from 'jqwidgets-ng/jqxscrollbar';
@Component({
selector: 'app-root',
imports: [jqxScrollbarModule],
standalone: true,
templateUrl: './app.component.html'
})
export class AppComponent {
@ViewChild('HorizontalDiv') HorizontalDiv: ElementRef;
@ViewChild('VerticalDiv') VerticalDiv: ElementRef;
onValueChangedVertical(event: any): void {
this.VerticalDiv.nativeElement.innerHTML = 'Vertical (' + parseInt(event.currentValue) + ')';
};
onValueChangedHorizontal(event: any): void {
this.HorizontalDiv.nativeElement.innerHTML = 'Horizontal (' + parseInt(event.currentValue) + ')';
};
}