tabs-accessibility
它能做什么
这项技能检查网页上的标签页组件是否具有正确的角色、状态和键盘行为。适用于在网站上构建标签页区域的开发者。
适用场景
- ✓当页面的标签页无法用键盘操作的时候。
- ✓当标签页的标记缺少 tablist、tab 或 tabpanel 角色的时候。
- ✓当你在构建新的标签页组件,且必须对屏幕阅读器用户有效的时候。
技能链接
https://github.com/thedaviddias/Front-End-Checklist/blob/main/skills/tabs-accessibility/SKILL.md复制后粘贴给你的 AI(Claude、ChatGPT 或 Cursor),让它按照说明操作。
使用方法
最简单的方法:复制下面的消息,粘贴给你的 AI。它会读取这个技能并按说明操作。
可直接粘贴的消息
适用于 Claude Code、Codex 或 Cursor:在项目文件夹中运行,即可安装该技能。
下载 SKILL.md,放进智能体的技能文件夹。
可以这样问 AI
“我为产品页面做了标签页,但无法用键盘操作。请帮我让它们具备无障碍功能。”
每周 5 个新技能,1 分钟读完。
工作原理
智能体会检查标签页的标记和键盘行为,然后添加所需的角色和关联,使方向键能在标签之间移动,并让每个面板与其标签相连。
技术内容(原始 SKILL.md)
作者在 GitHub 上的英文原文。
Make tabs keyboard navigable
Incorrectly implemented tabs trap keyboard users or leave screen reader users unable to understand the relationship between tabs and their content.
Quick Reference
- Use tablist, tab, and tabpanel roles
- Only one tab in the tab order at a time (roving tabindex)
- Arrow keys navigate between tabs, Tab moves to panel
- Connect tabs to panels with aria-controls/aria-labelledby
Check
Verify tabs use tablist/tab/tabpanel roles, aria-selected state, and arrow key navigation between tabs.
Fix
Implement tabs with role='tablist', role='tab', role='tabpanel', aria-selected, and proper keyboard interaction patterns.
Explain
Explain the ARIA tabs design pattern and how proper implementation ensures keyboard and screen reader accessibility.
Code Review
Review templates, server-rendered HTML, and shared components that output markup related to Make tabs keyboard navigable. Flag exact elements, attributes, and routes where the rendered HTML violates the rule.
For full implementation details, code examples, and framework-specific guidance,
see references/rule.md.
Rule page: https://frontendchecklist.io/rules/html/tabs-accessibility
常见问题
标签页应该响应哪些按键?
这项技能指出,方向键在标签之间移动,Tab 键则把焦点移入面板。
什么是 roving tabindex?
这意味着同一时间只有一个标签处于 Tab 顺序中,因此用户无需逐个按 Tab 键经过每个标签。
这取决于标签页的构建方式吗?
这项技能检查浏览器最终显示的 HTML,因此无论使用什么工具制作的标签页都适用。
详情
作者的原始描述
Use when reviewing templates, rendered HTML, or shared components related to Make tabs keyboard navigable. Validate the final browser-facing markup, not just the source framework abstraction.
热度
- GitHub 星标
- 75k
- 排名
- #3047
- 许可证
- MIT
- 更新时间
- 2026/10/31
评论
- …
同一仓库的更多技能
frontendchecklist
75k使用命令行工具,依据 380 多条关于无障碍、速度、SEO 和安全的规则,检查前端代码和线上页面。
frontend-checklist-global
75k依据全部 386 条 Front-End Checklist 规则审查前端项目,并为发现的每个问题给出具体修复方法。
404-page
75k检查你的页面缺失提示是否提供有用的链接,并返回真正的 404 状态,帮助迷路的访客找到方向。
about-page
75k审查你的网站是否有清晰的关于页面,说明由谁运营,以建立访客和搜索引擎的信任。