-
-
Notifications
You must be signed in to change notification settings - Fork 97
Migration Guide
Murhaf Sousli edited this page Sep 1, 2019
·
8 revisions
This guide highlights the changes happened in v5
v4 | v5 |
---|---|
npm i ngx-scrollbar @angular/cdk |
npm i ngx-scrollbar @angular/cdk @juggle/resize-observer |
v4 | v5 |
---|---|
[track]="vertical, horizontal, all" | |
[position]="native, invertX, invertY, invertAll" | |
[appearance]="standard, compact" | |
[trackClass] | |
[visibility] | |
This option has been removed completely |
- Before
.my-scrollbar {
--scrollbar-color: transparent;
--scrollbar-container-color: transparent;
--scrollbar-thumb-color: rgba(0, 0, 0, 0.2);
--scrollbar-thumb-hover-color: rgba(0, 0, 0, 0.3);
--scrollbar-border-radius: 4px;
--scrollbar-size: 6px;
--scrollbar-padding: 8px;
--scroll-view-margin: 0;
--scroll-view-color: transparent;
}
- After
.my-scrollbar {
--scrollbar-border-radius: 7px;
--scrollbar-padding: 4px;
--scrollbar-track-color: transparent;
--scrollbar-thumb-color: rgba(0, 0, 0, 0.2);
--scrollbar-thumb-hover-color: var(--scrollbar-thumb-color);
--scrollbar-size: 5px;
--scrollbar-hover-size: var(--scrollbar-size);
}
-
Before:
- Smooth scroll functions were observables
-
After:
- Smooth scroll functions became promises
-
The functions
ScrollXTo()
andScrollYTo()
are deprecated, now use onlyscrollTo()
Name | Default value | Description |
---|---|---|
[trackX] | false |
Horizontal scrollbar |
[trackY] | true |
Vertical scrollbar |
[invertX] | false |
Invert horizontal scrollbar position |
[invertY] | false |
Invert vertical scrollbar position |
[shown] | native |
Invert Vertical scrollbar position native , hover , always
|
[viewClass] | null | Add custom class to the view. |
[barClass] | null | Add custom class to scrollbars. |
[thumbClass] | null | Add custom class to scrollbars' thumbnails. |
[compact] | false |
Make scrollbars position appears over content. |
[disabled] | false |
Disable the custom scrollbars and use the native ones instead. |
[scrollToDuration] | 400 |
The smooth scroll duration when a scrollbar is clicked. |
[autoUpdate] | true |
Auto-update scrollbars on content changes. |
[disableOnBreakpoints] |
HandsetLandscape , HandsetPortrait
|
Disable custom scrollbars on specific breakpoints. |
Name | Default value | Description |
---|---|---|
[track] | vertical |
Directions to track horizontal , vertical , all
|
[position] | native |
Invert scrollbar position native ,invertX ,invertY , invertAll
|
[visibility] | native |
Scrollbar visibility native , hover , always
|
[appearance] | compact |
Scrollbar appearance standard , compact . |
[viewClass] | null | Add custom class to the view. |
[trackClass] | null | Add custom class to scrollbars' tracks. |
[thumbClass] | null | Add custom class to scrollbars' thumbnails. |
[disabled] | false |
Disable the custom scrollbars and use the native ones instead. |
[trackClickScrollDuration] | 400 |
The smooth scroll duration when a scrollbar is clicked. |
[minThumbSize] | 20 | The minimum scrollbar thumb size in px. |
[thumbDragDisabled] | false | A flag used to enable/disable the scrollbar thumb dragged event. |
[trackClickDisabled] | false | A flag used to enable/disable the scrollbar track clicked event. |
Become a sponsor and get your logo on our README on GitHub and the front page of https://ngx-scrollbar.netlify.com/.
Become a backer and get your logo on our README on GitHub.
Latest version (v14)
Addons:
Older version (v13)
- Demo for v13
- Usage
- Styling
- Global Options
- Pointer Events
- Scroll Event
- Updated Event
- Smooth Scroll Functions
- Performance tweak
- Integration
- Reached events