Angular Performance: Virtual Scrolling with the CDK
Reduce the amount of DOM nodes with CDK's virtual scrolling
1 min read
1 min read
Note: this article and attached Egghead video lesson are based on the articles on web.dev/angular by Minko Gechev and Stephen Fluin. Full credit goes to them 👍
Don’t miss the other videos by subscribing to my newsletter.
Browsers become faster every day, but still, DOM updates are costly. If we have large lists, the browser needs to render them upfront, creating hundreds if not thousands of DOM nodes, even though the user might not scroll that far down the list. Not only does this slow down the scrolling itself, but even the page load of our app can suffer from it. To optimize this experience, we can use virtual scrolling, in particular, in this lesson we’re using Angular’s CDK to implement that.
Wanna read the original web.dev article? Check it out here!.