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

accessible-notifications

它能做什么

这项技能检查屏幕上的消息能否被屏幕阅读器用户听到。适合希望重要通知能够传达给每位访客的网页开发者。

适用场景

  • ✓当你在构建表单错误提示或成功通知时。
  • ✓当页面在不刷新的情况下更新内容,屏幕阅读器可能会漏掉这种变化时。
  • ✓当你在审查共享的提醒组件的无障碍性时。

技能链接

https://github.com/thedaviddias/Front-End-Checklist/blob/main/skills/accessible-notifications/SKILL.md

复制后粘贴给你的 AI(Claude、ChatGPT 或 Cursor),让它按照说明操作。

使用方法

最简单的方法:复制下面的消息,粘贴给你的 AI。它会读取这个技能并按说明操作。

可直接粘贴的消息

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

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

repo: thedaviddias/Front-End-Checklist

热度

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

这个技能有用吗?

0

登录 后即可投票。

评论

  • …

同一仓库的更多技能

相似技能