跳到正文
Skillpedia
网站与界面(前端)75k · #2924

list-virtualization

它能做什么

这项技能检查一次性加载所有项目的长列表、表格和信息流,并建议只渲染屏幕上可见的部分。适用于构建仪表盘、搜索结果或信息流的开发者。

适用场景

  • ✓当你请智能体加快显示数百或数千行数据的页面的时候。
  • ✓当仪表盘、管理后台表格或信息流因数据量太大而滚动变慢的时候。
  • ✓当你想在添加更多代码之前,先确认长列表是否真的需要这项改动的时候。

技能链接

https://github.com/thedaviddias/Front-End-Checklist/blob/main/skills/list-virtualization/SKILL.md

复制后粘贴给你的 AI(Claude、ChatGPT 或 Cursor),让它按照说明操作。

使用方法

最简单的方法:复制下面的消息,粘贴给你的 AI。它会读取这个技能并按说明操作。

可直接粘贴的消息

请用这个技能帮我:https://github.com/thedaviddias/Front-End-Checklist/blob/main/skills/list-virtualization/SKILL.md 阅读该链接中的 SKILL.md 文件,并在我的任务中按照它的说明来做。
想让你的 AI 自己找到这样的技能吗?安装免费的 Skillpedia MCP:只需一行,每次任务前它都会在 15,000+ 个技能中搜索。1 分钟完成安装 →

可以这样问 AI

“我的管理后台表格有几千行,滚动很慢。请帮我让它更快一些。”

每周 5 个新技能,1 分钟读完。

工作原理

智能体会检查页面是否一次渲染了过多项目。如果是,它会建议使用窗口化方法,只在页面中保留可见的行以及一小段缓冲区。

技术内容(原始 SKILL.md)

作者在 GitHub 上的英文原文。

Virtualize long lists and tables

Rendering hundreds or thousands of rows at once wastes memory and makes style calculation, layout, and painting more expensive. Virtualization keeps large collections responsive by limiting the number of mounted nodes.

Quick Reference

  • Render only what is visible plus a small overscan buffer instead of the entire list
  • Use virtualization when repeated rows or cards push DOM size and layout cost too high
  • Preserve item sizing, keyboard access, and screen-reader semantics when windowing content
  • Measure scroll smoothness, memory use, and DOM node count before and after the change

Check

Inspect long lists, tables, grids, and feeds for places where the UI renders every item at once. Flag views where the number of mounted rows or cards is large enough to create DOM, memory, or scroll-performance issues.

Fix

Introduce list or table virtualization so only the visible rows plus overscan render, while preserving sizing, keyboard navigation, and any required sticky headers or selection behavior.

Explain

Explain list virtualization, why it improves performance for large collections, and the tradeoffs engineers need to watch for around measurement and accessibility.

Code Review

Inspect collection components, data tables, infinite feeds, and dashboards. Flag places where rendering the full dataset creates excessive DOM nodes or scroll jank, and verify the virtualization strategy still preserves item identity, semantics, and expected interactions.


For full implementation details, code examples, and framework-specific guidance, see references/rule.md.

Rule page: https://frontendchecklist.io/rules/performance/list-virtualization

常见问题

每个列表都需要这样做吗?

不需要。这项技能指出,小列表通常不需要这种额外的复杂性。

这会影响键盘操作吗?

可能会,因此智能体应保证键盘访问和屏幕阅读器支持仍然正常工作。

我怎么知道它是否有效?

这项技能建议在改动前后测量滚动流畅度、内存占用以及页面元素的数量。

详情

作者的原始描述

Use 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.

repo: thedaviddias/Front-End-Checklist

热度

GitHub 星标
75k
排名
#2924
许可证
MIT
更新时间
2026/10/31

这个技能有用吗?

0

登录 后即可投票。

评论

  • …

同一仓库的更多技能

相似技能