thedaviddias/Front-End-Checklist / skills/list-virtualization
list-virtualization
VerifiedUse when reviewing dashboards, admin tables, search results, or feeds with many repeated items. Confirm the bottleneck is DOM or rendering cost before introducing virtualization because small lists usually do not need the added complexity.
| File | Kind | Size |
|---|---|---|
| SKILL.md | skill md | 2.2 KB |
| references/rule.md | markdown | 3.1 KB |
references/rule.md
View on GitHub# Virtualize long lists and tables
> Render only the visible subset of rows or cards in large collections to reduce DOM size, memory usage, and scroll-time rendering work.
**Priority:** high · **Difficulty:** intermediate · **Time:** 25 min
---
List virtualization, also called windowing, renders only the rows or cards a user can currently see plus a small buffer. This keeps large collections responsive without forcing the browser to maintain thousands of mounted nodes.
## Code Examples
#
## Render Only Visible Rows
```tsx
return (
{({ index, style }) => (
<div style={style}>
{orders[index].customerName}
</div>
)}
)
}
```
### Avoid Rendering Every Row
```tsx
// ❌ Bad: Thousands of mounted nodes at once
return (
<table>
<tbody>
{orders.map((order) => (
<tr key={order.id}>
<td>{order.id}</td>
<td>{order.customerName}</td>
</tr>
))}
</tbody>
</table>
)
}
```
## Why It Matters
- **Smaller DOM**: The browser manages tens of nodes instead of thousands.
- **Lower memory pressure**: Mounted components, event handlers, and style data stay bounded.
- **Smoother scrolling**: Style recalculation, layout, and paint work stay predictable during long-list interactions.
- **Better interaction performance**: Selection, hover, expansion, and keyboard navigation remain responsive on dense screens.
## When to Use It
Virtualization is usually worth considering when:
- A single view renders more than roughly `100-200` repeated items
- DOM size approaches or exceeds roughly `1,500` total nodes
- Scrolling shows jank, dropped frames, or slow row interactions
- Tables or dashboards hold large datasets that users inspect incrementally
Avoid it when:
- The list is small enough to render normally
- SEO or full-document find-in-page behavior requires all content to be mounted
- Accessibility semantics would be degraded by a naive windowing implementation
## Standards
- Use Patterns.dev: List Virtualization as the standard for measuring the final production behavior, not just local synthetic output.
- Use web.dev: Virtualize large lists with react-window as the standard for measuring the final production behavior, not just local synthetic output.
## Verification
Cross-check the result against [react-window guidance on virtualized lists](https://web.dev/articles/virtualize-long-lists-react-window) so the DOM stays small without breaking keyboard or assistive-technology expectations.
1. Compare the mounted node count before and after the change and confirm the view no longer renders the full dataset at once.
2. Record a performance trace while scrolling and confirm layout, paint, and scripting work stay flatter with fewer long frames.
3. Verify keyboard navigation, row focus, selection state, and screen-reader labels still work as expected inside the virtualized list or table.
4. Tune the overscan buffer so fast scrolling does not reveal blank gaps while still keeping the mounted row count low.
5. Re-test memory usage and interaction responsiveness on lower-end mobile or laptop hardware if the list is part of a critical workflow.Related skills
| Skill | Stars | Updated | Works with | Status | Install |
|---|---|---|---|---|---|
| receiving-code-reviewobra/superpowersUse when receiving code review feedback, before implementing suggestions, especially if feedback seems unclear or technically questionable - requires technical rigor and verification, not performative agreement or blind implementation | Stars: 322k | Updated | Claude CodeCodex | Verified | Install |
| requesting-code-reviewobra/superpowersUse when completing tasks, implementing major features, or before merging to verify work meets requirements | Stars: 322k | Updated | Claude CodeCodex | Verified | Install |
| using-git-worktreesobra/superpowersUse when starting feature work that needs isolation from current workspace or before executing implementation plans - ensures an isolated workspace exists via native tools or git worktree fallback | Stars: 322k | Updated | Claude CodeCodex | Verified | Install |
| verification-before-completionobra/superpowersUse when about to claim work is complete, fixed, or passing, before committing or creating PRs - requires running verification commands and confirming output before making any success claims; evidence before assertions always | Stars: 322k | Updated | Claude CodeCodex | Verified | Install |