Perfect scrollbar library for angular
npm install @craftsjs/perfect-scrollbar
npm i @craftsjs/perfect-scrollbar perfect-scrollbar --S
`
Compatibility
Current version: 6.1.0 (Compatible with Angular v18)
How to use
Use the standalone directive in your component
`ts
import { Component } from '@angular/core';
import { PerfectScrollbarDirective } from '@craftsjs/perfect-scrollbar';
@Component({
selector: 'app-example',
standalone: true,
imports: [PerfectScrollbarDirective],
template:
})
export class ExampleComponent {}
`
`css
.menu-scroll-container{
position: relative; //this property is important
}
`
`html
`
Options
`ts
export interface Options {
handlers?: string[];
maxScrollbarLength?: number;
minScrollbarLength?: number;
scrollingThreshold?: number;
scrollXMarginOffset?: number;
scrollYMarginOffset?: number;
suppressScrollX?: boolean;
suppressScrollY?: boolean;
swipeEasing?: boolean;
useBothWheelAxes?: boolean;
wheelPropagation?: boolean;
wheelSpeed?: number;
}
`
`html
``