aria-required-attr
它能做什么
这项技能检查 ARIA 角色是否包含其必须具备的属性。适合用 ARIA 构建自定义滑块、开关和其他小组件的开发者。
适用场景
- ✓当你构建自定义滑块、开关或其他 ARIA 小组件时。
- ✓当屏幕阅读器无法报告某个控件的状态或数值时。
- ✓当你对照规范审查 ARIA 标记时。
技能链接
https://github.com/thedaviddias/Front-End-Checklist/blob/main/skills/aria-required-attr/SKILL.md复制后粘贴给你的 AI(Claude、ChatGPT 或 Cursor),让它按照说明操作。
使用方法
最简单的方法:复制下面的消息,粘贴给你的 AI。它会读取这个技能并按说明操作。
可直接粘贴的消息
适用于 Claude Code、Codex 或 Cursor:在项目文件夹中运行,即可安装该技能。
下载 SKILL.md,放进智能体的技能文件夹。
可以这样问 AI
“我的自定义滑块没有向屏幕阅读器报告它的数值。请找出缺少什么并修复。”
每周 5 个新技能,1 分钟读完。
工作原理
智能体会对照每个角色所需的属性进行检查,并添加缺失的属性,例如滑块需要的 aria-valuenow。
技术内容(原始 SKILL.md)
作者在 GitHub 上的英文原文。
Include required ARIA attributes for roles
Certain ARIA roles are incomplete without their required attributes, preventing assistive technologies from correctly communicating the element's state or value.
Quick Reference
- Identify roles that require specific state or property attributes
- Ensure attributes like
aria-valuenowfor sliders are present - Validate that all required ARIA attributes are correctly implemented
Check
Verify that all ARIA roles have their mandatory attributes as defined by the WAI-ARIA specification.
Fix
Add the missing required ARIA attributes to elements with specific roles (e.g., aria-valuenow for role="slider").
Explain
Explain how required ARIA attributes provide critical state information that screen readers need to function correctly.
Code Review
Review the rendered markup and interactive states that affect Include required ARIA attributes for roles. Flag exact elements, roles, labels, focus behavior, or keyboard interactions that violate the rule, and note how to verify the fix with browser accessibility tooling or assistive tech.
For full implementation details, code examples, and framework-specific guidance,
see references/rule.md.
Rule page: https://frontendchecklist.io/rules/accessibility/aria-required-attr
常见问题
为什么必需属性很重要?
这项技能说明,它们为辅助技术提供工作所需的状态或数值。
哪个角色是例子?
这项技能以滑块为例,它需要 aria-valuenow。
这项技能的要求清单来自哪里?
它以 WAI-ARIA 规范作为每个角色所需属性的依据。
详情
作者的原始描述
Use when reviewing rendered HTML, interactive components, or design-system patterns related to Include required ARIA attributes for roles. Check native semantics first, then inspect keyboard behavior, focus flow, accessible names, and screen-reader output where relevant.
热度
- GitHub 星标
- 75k
- 排名
- #2734
- 许可证
- MIT
- 更新时间
- 2026/10/31
评论
- …
同一仓库的更多技能
frontendchecklist
75k使用命令行工具,依据 380 多条关于无障碍、速度、SEO 和安全的规则,检查前端代码和线上页面。
frontend-checklist-global
75k依据全部 386 条 Front-End Checklist 规则审查前端项目,并为发现的每个问题给出具体修复方法。
404-page
75k检查你的页面缺失提示是否提供有用的链接,并返回真正的 404 状态,帮助迷路的访客找到方向。
about-page
75k审查你的网站是否有清晰的关于页面,说明由谁运营,以建立访客和搜索引擎的信任。