What is virtual scrolling and when should you use it?

Angular performance and SSR · Experienced

Model answer

Virtual scrolling (from the Angular CDK) renders only the items visible in the viewport plus a small buffer, and reuses elements as the user scrolls. This keeps the DOM small, so lists with thousands of rows stay fast.

Use it for very long lists or tables. Drawbacks: items usually need a known or estimated height, browser find-in-page cannot find rows that are not rendered, and accessibility needs care. For lists of a few hundred items, normal rendering with track is simpler.

Learn this topic

Angular Tutorial: Beginner to Advanced .

Sign in to add your own answer.

More questions