Ankit Mishra
Ankit Mishra

Reputation: 189

Please suggest any scrollbar plugin for angular 6

I tried 3 plugins for scroll bar this is the image where I want to insert scroll bar but not getting the results as required ,I want to use scroll bar for angular 6

Plugins reffered are below:

https://www.npmjs.com/package/ngx-perfect-scrollbar

[https://www.npmjs.com/package/ngx-malihu-scrollbar#demo-application][2]

[https://www.npmjs.com/package/angular-smooth-scrollbar][3]

Upvotes: 3

Views: 10743

Answers (4)

Ankit Mishra
Ankit Mishra

Reputation: 189

For scroll bar we can use this also:

Have a look below :use this in the section in which you need scroll bar

<div [style.overflow]="'auto'" [style.height.px]="'250'">

Upvotes: 3

Dima Shivrin
Dima Shivrin

Reputation: 99

Try angular material.

Angular material scrolling

Upvotes: 0

Bas de Groot
Bas de Groot

Reputation: 676

Why not just use the Angular Material scrolling package?

Install Angular CDK

npm install --save @angular/cdk

Import the scrolling module

import {ScrollingModule} from '@angular/cdk/scrolling';

HTML

<cdk-virtual-scroll-viewport itemSize="1" class="viewport">
    <div class="scrolling-example">
        Insert text here...
    </div>
</cdk-virtual-scroll-viewport>

CSS

.viewport {
    height: 200px;
    width: 200px;
    border: 1px solid black;
}

.scrolling-example {
    height: auto;
}

For more details see the Angular CDK scrolling documentation

For a working example see: Stackblitz

Upvotes: -1

Hana Wujira
Hana Wujira

Reputation: 880

I suggest you to use ngx-perfect-scrollbar and if you need example how to use it check this

Upvotes: 3

Related Questions