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

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。它会读取这个技能并按说明操作。

可直接粘贴的消息

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

可以这样问 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-valuenow for 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.

repo: thedaviddias/Front-End-Checklist

热度

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

这个技能有用吗?

0

登录 后即可投票。

评论

  • …

同一仓库的更多技能

相似技能