帮助开发者为 React 与 Next.js 交互界面实现无障碍设计与可用性优化。
该技能材料表现为前端无障碍开发指南,属于纯提示/文档型内容,不要求密钥、未声明远程端点,也未体现本地执行或数据外发能力。结合 GitHub 开源与较高社区采用度,整体风险低;仅供应链方面因许可证未声明、维护状态未知需轻微留意。
材料明确标注无需密钥或环境变量,内容也仅为 React/Next.js 无障碍模式说明,未见凭证收集、存储、传输或滥用路径。
未声明任何远程端点,且系统检查项显示为 prompt-only;README 内容是本地代码示例与规范说明,未见将用户数据发送到外部服务的设计。
作为 Skill 技能材料,其内容是静态开发建议与示例代码,没有要求安装可执行组件、启动本地进程或调用系统命令的描述。
文档未声明读取或写入本地文件、数据库、浏览器存储或其他资源的权限需求;示例仅展示常见表单与交互组件的可访问性写法,不构成数据访问能力。
来源为 GitHub 开源仓库,且社区采用度很高,这些都是明显的降风险因素;但许可证未声明、维护状态未知,审计时仍应对后续变更与依赖来源保持基本关注。
复制安装指令,让 AI 自动完成配置 · 推荐新手
请帮我安装 askskill 上的 "frontend-a11y" 技能: 1. 下载 https://raw.githubusercontent.com/affaan-m/ECC/main/skills/frontend-a11y/SKILL.md 2. 保存为 ~/.claude/skills/frontend-a11y/SKILL.md 3. 装好后重载技能,告诉我可以用了
请检查这段 React 表单组件的无障碍问题,并直接给出改进后的代码。重点关注语义化 HTML、label 绑定、错误提示关联、键盘可操作性和屏幕阅读器支持。
一版改进后的表单代码,并附上主要无障碍修复点说明。
请为 Next.js 项目生成一个无障碍弹窗组件,要求支持焦点陷阱、Esc 关闭、初始焦点设置、关闭后焦点返回,以及必要的 ARIA 属性。
可直接使用的弹窗组件代码,以及交互与无障碍实现说明。
下面是一个 React 下拉菜单组件,请做无障碍审查,指出问题并给出修复方案。重点检查角色属性、键盘导航、焦点管理和屏幕阅读器提示。
问题清单、修复建议,以及可参考的优化后代码片段。
Practical accessibility patterns for React and Next.js. Covers the issues most commonly flagged in code review: missing form labels, incorrect ARIA usage, non-semantic interactive elements, and broken keyboard navigation.
<input>, <select>, <textarea>)<div> or <span> with onClickaria-* attributes to any elementMissing htmlFor / id pairing and disconnected error messages are the most common issues flagged in code review.
// BAD: label has no connection to input — screen readers cannot associate them
<label>Email</label>
<input type="email" />
// GOOD: htmlFor matches input id
<label htmlFor="email">Email</label>
<input id="email" type="email" />
// BAD: visual-only asterisk conveys nothing to screen readers
<label htmlFor="email">Email *</label>
<input id="email" type="email" />
// GOOD: required enables native browser validation; aria-required signals it to screen readers
<label htmlFor="email">
Email <span aria-hidden="true">*</span>
</label>
<input id="email" type="email" required aria-required="true" />
// BAD: error text exists visually but is not linked to the input
<input id="email" type="email" />
<span className="error">Invalid email address</span>
// GOOD: aria-describedby connects input to its error message
// aria-invalid signals the invalid state to screen readers
<input
id="email"
type="email"
aria-describedby="email-error"
aria-invalid={!!error}
/>
{error && (
<span id="email-error" role="alert">
{error}
</span>
)}
interface LoginFormProps {
onSubmit: (email: string, password: string) => void;
}
export function LoginForm({ onSubmit }: LoginFormProps) {
const [email, setEmail] = useState('');
const [password, setPassword] = useState('');
const [errors, setErrors] = useState<{ email?: string; password?: string }>({});
const handleSubmit = (e: React.FormEvent) => {
e.preventDefault();
const newErrors: typeof errors = {};
if (!email) newErrors.email = 'Email is required';
if (!password) newErrors.password = 'Password is required';
if (Object.keys(newErrors).length) {
setErrors(newErrors);
return;
}
onSubmit(email, password);
};
return (
<form onSubmit={handleSubmit} noValidate>
<div>
<label htmlFor="email">
Email <span aria-hidden="true">*</span>
</label>
<input
id="email"
type="email"
value={email}
onChange={e => setEmail(e.target.value)}
aria-required="true"
aria-describedby={errors.email ? 'email-error' : undefined}
aria-invalid={!!errors.email}
autoComplete="email"
/>
{errors.email && (
<span id="email-error" role="alert">
{errors.email}
</span>
)}
</div>
<div>
<label htmlFor="password">
Password <span aria-hidden="true">*</span>
</label>
<input
id="password"
type="password"
value={password}
onChange={e => setPassword(e.target.value)}
aria-required="true"
aria-describedby={errors.password ? 'password-error' : undefined}
aria-invalid={!!errors.password}
autoComplete="current-password"
/>
{errors.password && (
<span id="password-error" role="alert">
{errors.password}
</span>
)}
</div>
…
帮助开发者系统掌握 Laravel 测试驱动开发与自动化测试实践。
为 Claude Code 会话建立正式评估流程,支持评测驱动开发与质量验证
帮助你为自适应智能体设计任务编排、评测门控与可复用技能提炼方案
基于多源网页检索与综合分析,生成带引用和来源标注的深度研究报告
为 orch 系列技能统一编排研发流程与人工审批关卡
将缺陷修复流程编排为复现、修复、评审与门禁提交的自动协作任务
帮助你梳理 React 与 Next.js 前端模式、状态管理及性能优化最佳实践
审查设计稿或页面的无障碍性,识别并说明 WCAG 2.1 AA 合规问题。
帮助你编写或审查符合 React 18/19 最佳实践的组件与架构。
帮助开发者构建 React 微前端架构,并实现共享依赖、动态表单与状态管理。
帮助你为 React 组件、Hook 与页面编写、修复并优化测试方案。
帮助开发者构建同时适合 AI 代理与人类使用的友好型网页界面。