accessible-notifications
它能做什么
这项技能检查屏幕上的消息能否被屏幕阅读器用户听到。适合希望重要通知能够传达给每位访客的网页开发者。
适用场景
- ✓当你在构建表单错误提示或成功通知时。
- ✓当页面在不刷新的情况下更新内容,屏幕阅读器可能会漏掉这种变化时。
- ✓当你在审查共享的提醒组件的无障碍性时。
技能链接
https://github.com/thedaviddias/Front-End-Checklist/blob/main/skills/accessible-notifications/SKILL.md复制后粘贴给你的 AI(Claude、ChatGPT 或 Cursor),让它按照说明操作。
使用方法
最简单的方法:复制下面的消息,粘贴给你的 AI。它会读取这个技能并按说明操作。
可直接粘贴的消息
适用于 Claude Code、Codex 或 Cursor:在项目文件夹中运行,即可安装该技能。
下载 SKILL.md,放进智能体的技能文件夹。
可以这样问 AI
“请确保我的联系表单上的错误提示能被屏幕阅读器读出来。”
每周 5 个新技能,1 分钟读完。
工作原理
智能体会检查 live region 以及 alert、status 等正确角色的设置,并确认消息会停留足够长的时间供人阅读,并且可以关闭。
技术内容(原始 SKILL.md)
作者在 GitHub 上的英文原文。
Make notifications accessible
Without proper ARIA attributes, screen reader users miss critical notifications like form errors, success messages, and real-time updates—leaving them unaware of important page changes.
Quick Reference
- Use aria-live regions to announce dynamic content changes
- Choose between 'polite' (waits) and 'assertive' (interrupts) based on urgency
- Ensure notifications persist long enough to be read
- Provide visible and programmatic dismiss options
Check
Verify notifications use aria-live regions, appropriate role (alert or status), and persist long enough to be read.
Fix
Implement notifications with role='alert' or role='status', aria-live='polite' or 'assertive', and adequate display time.
Explain
Explain how accessible notifications ensure all users are informed of important updates regardless of how they interact with the page.
Code Review
Review templates, server-rendered HTML, and shared components that output markup related to Make notifications accessible. 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/accessible-notifications
常见问题
什么是 live region?
它是页面上的一个区域,当其内容变化时,屏幕阅读器会将其读出。
消息应该用 polite 还是 assertive?
这项技能说明,一般更新使用 polite,紧急情况使用 assertive。
通知需要关闭的方式吗?
需要。这项技能建议同时提供可见的关闭按钮和程序化的关闭方式。
详情
作者的原始描述
Use when reviewing templates, rendered HTML, or shared components related to Make notifications accessible. Validate the final browser-facing markup, not just the source framework abstraction.
热度
- GitHub 星标
- 75k
- 排名
- #2710
- 许可证
- MIT
- 更新时间
- 2026/10/31
评论
- …
同一仓库的更多技能
frontendchecklist
75k使用命令行工具,依据 380 多条关于无障碍、速度、SEO 和安全的规则,检查前端代码和线上页面。
frontend-checklist-global
75k依据全部 386 条 Front-End Checklist 规则审查前端项目,并为发现的每个问题给出具体修复方法。
404-page
75k检查你的页面缺失提示是否提供有用的链接,并返回真正的 404 状态,帮助迷路的访客找到方向。
about-page
75k审查你的网站是否有清晰的关于页面,说明由谁运营,以建立访客和搜索引擎的信任。