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

search-input

它能做什么

这个技能检查网站的搜索框和搜索表单,使其对所有人都可用,包括依赖屏幕阅读器或键盘的用户。它面向希望访客能轻松找到内容的网站构建者。

适用场景

  • ✓你请智能体检查网站搜索框的无障碍性的时候。
  • ✓屏幕阅读器用户无法判断搜索字段用途的时候。
  • ✓你添加自动补全建议,并希望它们可以用键盘操作的时候。

技能链接

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

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

使用方法

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

可直接粘贴的消息

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

可以这样问 AI

“请帮我检查网站的搜索框,确保屏幕阅读器用户和键盘用户都能使用它吗?”

每周 5 个新技能,1 分钟读完。

工作原理

智能体会检查搜索字段是否使用 search 输入类型,是否有可见或供屏幕阅读器读取的标签,以及是否位于具有 search 角色的表单中。它还会检查建议项能否用键盘到达,以及结果数量是否会被播报。

技术内容(原始 SKILL.md)

作者在 GitHub 上的英文原文。

Make search inputs accessible

Search is a primary navigation method—inaccessible search functionality prevents users from finding content efficiently regardless of their abilities.

Quick Reference

  • Use type='search' and role='search' on the form
  • Provide visible or screen reader accessible label
  • Make autocomplete suggestions keyboard navigable
  • Announce result counts to screen readers

Check

Verify search inputs use type='search', have accessible labels, and use role='search' on the containing form.

Fix

Implement search with type='search', visible or aria-label, form role='search', and accessible autocomplete suggestions.

Explain

Explain how accessible search implementations help users find content efficiently regardless of their abilities.

Code Review

Review templates, server-rendered HTML, and shared components that output markup related to Make search inputs 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/search-input

常见问题

为什么搜索需要无障碍?

这个技能说,搜索是人们在网站中移动的主要方式之一,搜索失效会使他们无法找到内容。

智能体会改变搜索框的外观吗?

当设计隐藏了可见标签时,它可以添加 aria-label,因此不必改变外观。

结果如何被播报?

这个技能建议在结果更新时,向屏幕阅读器播报结果数量。

详情

作者的原始描述

Use when reviewing templates, rendered HTML, or shared components related to Make search inputs accessible. Validate the final browser-facing markup, not just the source framework abstraction.

repo: thedaviddias/Front-End-Checklist

热度

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

这个技能有用吗?

0

登录 后即可投票。

评论

  • …

同一仓库的更多技能

相似技能