keyboard-navigation
Skill này làm gì
Skill này kiểm tra mọi phần tương tác của trang có hoạt động với phím Tab không và focus có di chuyển theo thứ tự hợp lý không. Skill dành cho lập trình viên và nhà thiết kế muốn website dễ tiếp cận.
Khi nào nên dùng
- ✓Khi một nút hoặc liên kết không thể tới bằng phím Tab.
- ✓Khi phần tử ẩn vẫn có thể nhận focus bàn phím.
- ✓Khi người dùng bàn phím bị kẹt trong một phần của trang.
Liên kết skill
https://github.com/thedaviddias/Front-End-Checklist/blob/main/skills/keyboard-navigation/SKILL.mdSao chép rồi dán vào AI của bạn (Claude, ChatGPT hoặc Cursor) và nhờ nó làm theo hướng dẫn.
Cách dùng
Cách dễ nhất: sao chép tin nhắn và dán vào AI của bạn. AI sẽ đọc skill và làm theo hướng dẫn.
Tin nhắn có sẵn để dán
Dành cho Claude Code, Codex hoặc Cursor: chạy lệnh trong thư mục dự án của bạn và skill sẽ được cài đặt.
Tải tệp SKILL.md về và thả vào thư mục skill của agent.
Ví dụ cách nhờ AI
“Bạn có thể kiểm tra mọi điều khiển trên website của tôi có hoạt động chỉ bằng bàn phím không?”
5 skill mới mỗi tuần. Đọc chỉ 1 phút.
Cách hoạt động
Agent kiểm tra thứ tự Tab, xác nhận các phần tử ẩn bị loại khỏi focus và tìm chỗ bẫy. Agent gợi ý sửa thứ tự DOM và thiết lập tabindex khi cần.
Nội dung kỹ thuật (SKILL.md gốc)
Lấy nguyên văn từ GitHub, do tác giả viết bằng tiếng Anh.
Enable keyboard navigation for all elements
15% of users rely on keyboard navigation—broken focus order or keyboard traps make your site completely unusable for them.
Quick Reference
- All interactive elements must be reachable via Tab key
- Focus order should follow visual reading order (left-to-right, top-to-bottom)
- Never use positive tabindex values—they break natural flow
- Hidden content must be removed from tab sequence with tabindex='-1'
- Keyboard traps are only acceptable inside active modals with a working Escape path
Check
Test that all interactive elements are keyboard accessible, focus order matches visual/reading order, hidden content is not focusable, and no keyboard traps exist except in modals with proper escape handling.
Fix
Ensure tab order follows DOM order matching visual layout. Use tabindex='-1' to remove hidden elements from focus. Avoid positive tabindex values. Ensure off-screen or display:none content cannot receive focus.
Explain
Explain how logical focus order helps keyboard users navigate efficiently, why hidden elements must be removed from the tab sequence to avoid confusion, and how focus management affects users of screen readers and switch devices.
Code Review
Review the rendered markup and interactive states that affect Enable keyboard navigation for all elements. 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/keyboard-navigation
Câu hỏi thường gặp
Vì sao truy cập bằng bàn phím quan trọng?
Skill nói nhiều người dựa vào bàn phím, gồm người khuyết tật vận động và người dùng trình đọc màn hình.
Khi nào bẫy bàn phím được chấp nhận?
Skill nói chỉ được có bên trong một modal đang mở và có đường thoát Escape hoạt động.
Có nên dùng giá trị tabindex dương không?
Skill nói không nên, vì giá trị dương làm hỏng luồng tự nhiên.
Chi tiết
Mô tả gốc của tác giả
Use when reviewing rendered HTML, interactive components, or design-system patterns related to Enable keyboard navigation for all elements. Check native semantics first, then inspect keyboard behavior, focus flow, accessible names, and screen-reader output where relevant.
Độ phổ biến
- Sao GitHub
- 75k
- Vị trí xếp hạng
- #2908
- Giấy phép
- MIT
- Cập nhật
- 31/10/2026
Bình luận
- …
Thêm skill từ kho mã này
frontendchecklist
75kKiểm tra mã frontend và trang trực tiếp theo hơn 380 quy tắc về khả năng tiếp cận, tốc độ, SEO và bảo mật, bằng một công cụ dòng lệnh.
frontend-checklist-global
75kKiểm toán một dự án frontend theo đủ 386 quy tắc của Front-End Checklist, và đưa cách sửa cụ thể cho từng vấn đề tìm thấy.
404-page
75kKiểm tra xem trang báo thiếu của bạn có đưa ra các liên kết hữu ích và trả về mã trạng thái 404 thật hay không, để giúp khách bị lạc tìm đường.
about-page
75kKiểm tra xem trang web có trang Giới thiệu rõ ràng giải thích ai điều hành nó hay không, để xây dựng niềm tin với khách và công cụ tìm kiếm.
Skill tương tự
angular-developer
280kGiúp agent của bạn viết code Angular và tư vấn cấu trúc dự án, hữu ích khi bắt đầu dự án mới hoặc cải thiện hiệu suất.
frontend-a11y
280kGiúp agent của bạn làm cho giao diện web dễ tiếp cận với mọi người. Đảm bảo website và ứng dụng hoạt động tốt với trình đọc màn hình và điều hướng bằng bàn phím.
frontend-patterns
280kGiúp agent của bạn áp dụng các mẫu hiện đại trong phát triển frontend. Tối ưu hiệu năng, quản lý trạng thái và tuân theo thực hành tốt nhất với React và Next.js.