list-virtualization
它能做什么
这项技能检查一次性加载所有项目的长列表、表格和信息流,并建议只渲染屏幕上可见的部分。适用于构建仪表盘、搜索结果或信息流的开发者。
适用场景
- ✓当你请智能体加快显示数百或数千行数据的页面的时候。
- ✓当仪表盘、管理后台表格或信息流因数据量太大而滚动变慢的时候。
- ✓当你想在添加更多代码之前,先确认长列表是否真的需要这项改动的时候。
技能链接
https://github.com/thedaviddias/Front-End-Checklist/blob/main/skills/list-virtualization/SKILL.md复制后粘贴给你的 AI(Claude、ChatGPT 或 Cursor),让它按照说明操作。
使用方法
最简单的方法:复制下面的消息,粘贴给你的 AI。它会读取这个技能并按说明操作。
可直接粘贴的消息
适用于 Claude Code、Codex 或 Cursor:在项目文件夹中运行,即可安装该技能。
下载 SKILL.md,放进智能体的技能文件夹。
可以这样问 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.
热度
- GitHub 星标
- 75k
- 排名
- #2924
- 许可证
- MIT
- 更新时间
- 2026/10/31
评论
- …
同一仓库的更多技能
frontendchecklist
75k使用命令行工具,依据 380 多条关于无障碍、速度、SEO 和安全的规则,检查前端代码和线上页面。
frontend-checklist-global
75k依据全部 386 条 Front-End Checklist 规则审查前端项目,并为发现的每个问题给出具体修复方法。
404-page
75k检查你的页面缺失提示是否提供有用的链接,并返回真正的 404 状态,帮助迷路的访客找到方向。
about-page
75k审查你的网站是否有清晰的关于页面,说明由谁运营,以建立访客和搜索引擎的信任。