Overview - Virtual scrolling for large lists
What is it?
Virtual scrolling is a technique used to efficiently display very long lists by only rendering the items visible on the screen. Instead of loading all items at once, it dynamically loads and unloads items as the user scrolls. This keeps the app fast and responsive even with thousands of items. Angular provides built-in support for virtual scrolling through its CDK (Component Dev Kit).
Why it matters
Without virtual scrolling, apps that show large lists become slow and use too much memory because they try to render every item at once. This can make the app freeze or crash, especially on slower devices. Virtual scrolling solves this by only showing what the user can see, making the app smooth and fast. This improves user experience and saves device resources.
Where it fits
Before learning virtual scrolling, you should understand basic Angular components, templates, and how lists are rendered with *ngFor. After mastering virtual scrolling, you can explore advanced performance optimizations like infinite scrolling, lazy loading data, and custom scroll strategies.