Skip to content
Back to skills

Virtualized Lists

ASecurity

Render only visible rows for long lists (1k+ rows) using intersection observer or lightning-datatable virtual scroll. NOT for simple lists under 100 rows.

  • 15 stars
  • 0 votes
  • 0 copies
  • 5 views
  • Added June 1, 2026
ai-agentsgonodespringgitperformance

Works with

  • cli

Security analysis

A100/100

Pro scans all 7 files and shows the line behind each finding

Scanned June 1, 2026

npx -y skills add PranavNagrecha/AwesomeSalesforceSkills --skill virtualized-lists --agent claude-code

Installs into .claude/skills of the current project.

Are you the author of Virtualized Lists?

Add the live security badge to your README. It updates with every re-scan.

Security grade badge for Virtualized Lists
[![Security: A — Skills Directory](https://www.skillsdirectory.com/api/skills/pranavnagrecha-virtualized-lists/badge)](https://www.skillsdirectory.com/skills/pranavnagrecha-virtualized-lists)

More formats (shields.io, HTML) on the badges page. Keep it an A: scan every change in CI with Pro.

Download with Pro
SKILL.md
---
name: virtualized-lists
description: "Render only visible rows for long lists (1k+ rows) using intersection observer or lightning-datatable virtual scroll. NOT for simple lists under 100 rows."
category: lwc
salesforce-version: "Spring '25+"
well-architected-pillars:
  - Performance
  - User Experience
triggers:
  - "lwc slow list 10000 rows"
  - "virtualize lwc"
  - "lightning datatable performance"
  - "infinite scroll lwc"
tags:
  - performance
  - virtualization
  - datatable
inputs:
  - "row count"
  - "row height (fixed or variable)"
outputs:
  - "virtualized component or datatable config"
dependencies: []
version: 1.0.0
author: Pranav Nagrecha
updated: 2026-04-28
---

# LWC Virtualized Lists

Rendering 10,000 DOM nodes crashes mobile and lags desktop. Virtualization renders only ~2 screens worth of rows and swaps them as the viewport scrolls. `lightning-datatable` has built-in infinite scroll; for custom layouts use an IntersectionObserver-based pattern with fixed row height. This skill covers both paths plus the accessibility requirements (aria-rowcount, keyboard reachability) that are easy to miss when optimizing for performance.

## Adoption Signals

Lists beyond 500 rows or tables beyond 1000. Not for simple short lists.

- Required when initial render time exceeds 500ms or the user reports janky scroll on lower-end devices.
- Required for tables with computed columns (formulas, joins) where each row's render cost compounds.

## Recommended Workflow

1. Measure: if first render <100ms, skip virtualization.
2. `lightning-datatable enable-infinite-loading` + `onloadmore` handler that paginates server-side.
3. Custom: fixed row height + IntersectionObserver sentinels + windowed render of visible + buffer rows.
4. Cache row data client-side; server returns pages of 50–200.
5. Test with 10,000-row fixture to measure FPS and memory.

## Key Considerations

- Variable row heights break naive virtualization; use a measured-height library or fix the height.
- Screen readers must see a meaningful row count (`aria-rowcount`).
- Keyboard navigation must still reach off-screen rows logically.
- Server pagination > client-side filtering for 10k+ datasets.

## Worked Examples (see `references/examples.md`)

- *10k-row datatable* — Audit log viewer
- *Custom list with IO* — Activity feed

## Common Gotchas (see `references/gotchas.md`)

- **Variable row height** — Items jump around on scroll.
- **aria-rowcount missing** — Screen reader reports 'list with 20 items' on a 10k list.
- **Client-side filter on big list** — Re-filters 10k rows on each keystroke; jank.

## Top LLM Anti-Patterns (full list in `references/llm-anti-patterns.md`)

- Rendering 10k rows directly
- Client-side filter on huge datasets
- Missing aria-rowcount

## Official Sources Used

- Lightning Web Components Developer Guide — https://developer.salesforce.com/docs/platform/lwc/guide/
- Lightning Data Service — https://developer.salesforce.com/docs/platform/lwc/guide/data-wire-service-about.html
- LWC Recipes — https://github.com/trailheadapps/lwc-recipes
- SLDS 2 — https://www.lightningdesignsystem.com/2e/

Files in this skill

  • SKILL.md3.1 KB
  • references/examples.md559 B
  • references/gotchas.md625 B
  • references/llm-anti-patterns.md220 B
  • references/well-architected.md533 B
  • scripts/check_virtualized_lists.py909 B
  • templates/virtualized-lists-template.md540 B

Attribution

Is this your skill, or is something wrong with this listing? Request removal or report an issue. Author removals are honored within 72 hours.

Comments

Loading comments…

Newsletter

Get the weekly list of safe new skills, and the ones we pulled.