OverlayScrollbars icon indicating copy to clipboard operation
OverlayScrollbars copied to clipboard

OverlayScrollbars with Virtualization Libraries

Open KingSora opened this issue 1 year ago • 12 comments

Since this is a pretty frequent topic I've decided to create a list of examples where OverlayScrollbars plays together with various virtualization libraries.

If your library or framework of choice is not in this list, please respond in this issue with the name & link of the library and if possible with an minimal example on StackBlitz. You can also create a separate issue.

React

react-window (package)

react-virtualized (package)

react-virtuoso (package)

@tanstack/react-virtual (package)

virtua (package)

@ag-grid-community/react (package)

@handsontable/react (package)

masonic (package)

Angular

@angular/cdk (package)

KingSora avatar May 21 '24 11:05 KingSora

Hi. Can you tell me how to connect react-virtualized to overlayscrollbars-react?

Tishkin avatar Jul 05 '24 15:07 Tishkin

@Tishkin I'm currently on vacation and wont be able to create an example for at least another week

KingSora avatar Jul 05 '24 19:07 KingSora

@Tishkin I've added the following examples for you:

react-virtualized (package)

KingSora avatar Jul 26 '24 11:07 KingSora

which one is better performance

xmsz-stu avatar Sep 05 '24 02:09 xmsz-stu

@KingSora , hi, can you add example, how to use overlayscrollbars-react with virtua ? (https://github.com/inokawa/virtua)

airspin avatar Oct 24 '24 08:10 airspin

@airspin I've added the following examples:

virtua (package)

KingSora avatar Nov 14 '24 08:11 KingSora

@KingSora hi, I would be great to have example with angular virtual scroll (https://material.angular.io/cdk/scrolling/overview)

de-don avatar Nov 20 '24 08:11 de-don

@de-don I've added the following examples:

@angular/cdk (package)

KingSora avatar Nov 29 '24 11:11 KingSora

Hi would you like to add example of masonic (https://www.npmjs.com/package/masonic)

demo: https://codesandbox.io/s/0oyxozv75v

sep2 avatar Dec 04 '24 17:12 sep2

@sep2

I've added the following examples:

masonic (package)

KingSora avatar Dec 16 '24 09:12 KingSora

@KingSora The example for virtua is broken, no scrollbar is shown.

https://stackblitz.com/edit/vitejs-vite-t1cjd9fr?file=package.json

This reproduction is forked from the example abobe, with only changes to update virtua and overlayscrollbars to the latest version.

sep2 avatar May 16 '25 16:05 sep2

@sep2 sorry for the inconvenience, thats because of a small oversight from my side in the v2.11.2 release. I've published v2.11.3 which should fix the issue: https://stackblitz.com/edit/vitejs-vite-ymr6o96k

KingSora avatar May 17 '25 12:05 KingSora

For Vue-based projects, the combination of the libraries overlayscrollbars-vue and @tanstack/vue-virtual works well.

There are no readily available implementation examples of this combination online.

It is important to create a custom wrapper component around overlayscrollbars-vue that exposes a reference to the DOM element with a styled scrollbar. This DOM reference should then be used as the scroll container for @tanstack/vue-virtual to apply its virtualization logic.

DmitriyWebDev avatar Jul 31 '25 13:07 DmitriyWebDev

With Angular, I can't make it work .... The only result is that my 12 first cards scrolls... but finally, the place for other cards is empty... and it is only these 12 first cards..

If I remove the parentScroll attribute, virtual-scroller uses its own scrollbars....

sad ;(

"@iharbeck/ngx-virtual-scroller": "^19.0.1",
"overlayscrollbars": "^2.12.0",
"overlayscrollbars-ngx": "^0.5.2",

` <overlay-scrollbars [options]="{ scrollbars: { autoHide: 'move'} }" #osTarget> <virtual-scroller #scroll [items]="panel.cacheFilteredPostits" [horizontal]="false" [parentScroll]="osTarget.getElement()" [enableUnequalChildrenSizes]="true"> @for (postit of scroll.viewPortItems; track postit; let index = $index) {

<ng-container *ngTemplateOutlet="entryTemplates['postit']; context: asTemplateContext(postit)">
}

`

samfrach avatar Sep 16 '25 13:09 samfrach

@samfrach Good day :)

I've added a working example for you:

@iharbeck/ngx-virtual-scroller (package)

KingSora avatar Sep 19 '25 14:09 KingSora

Hi, I think the angular/cdk example is missing some code, it doesn't render any items I don't see the scrolling module being used anywhere.

PieckaAndrej avatar Oct 29 '25 15:10 PieckaAndrej

@PieckaAndrej you are right.. not sure how that happened.. Should be working again :)

KingSora avatar Oct 29 '25 15:10 KingSora

Hello, could you add an example for Glide Data Grid? Thanks in advance.

jeffvli avatar Nov 12 '25 01:11 jeffvli

@jeffvli

Here is an example with Glide Data Grid:

@glideapps/glide-data-grid (package)

KingSora avatar Nov 14 '25 10:11 KingSora

Thank you! I also just wanted to mention that react-window has released a v2 version that may need an updated example.

jeffvli avatar Nov 14 '25 10:11 jeffvli