Chuyển đến nội dung
Skillpedia
Website và giao diện (frontend)75k · #2742

aria-valid-attr-value

Skill này làm gì

Skill này kiểm tra giá trị bên trong các thuộc tính ARIA có đúng định dạng hay không. Skill dành cho lập trình viên muốn trình đọc màn hình báo đúng trạng thái của phần tử.

Khi nào nên dùng

  • ✓Khi bạn tự viết các thuộc tính như aria-expanded hoặc aria-checked.
  • ✓Khi một label trỏ tới ID không có trên trang.
  • ✓Khi bạn rà soát component để tìm lỗi ARIA.

Liên kết skill

https://github.com/thedaviddias/Front-End-Checklist/blob/main/skills/aria-valid-attr-value/SKILL.md

Sao 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

Hãy dùng skill này để giúp tôi: https://github.com/thedaviddias/Front-End-Checklist/blob/main/skills/aria-valid-attr-value/SKILL.md Đọc tệp SKILL.md tại liên kết đó và làm theo hướng dẫn cho việc của tôi.
Bạn muốn AI tự tìm những skill như thế này?Cài MCP Skillpedia miễn phí: chỉ một dòng, và AI sẽ tìm trong 15.000+ skill trước mỗi việc.Cài đặt trong 1 phút →

Ví dụ cách nhờ AI

“Hãy kiểm tra code dropdown của tôi xem có giá trị ARIA sai kiểu hoặc ID trỏ tới phần tử không tồn tại hay không.”

5 skill mới mỗi tuần. Đọc chỉ 1 phút.

Cách hoạt động

Agent so sánh từng giá trị ARIA với kiểu được phép, chẳng hạn true hoặc false, rồi kiểm tra các ID được nêu trong thuộc tính như aria-labelledby có tồn tại trên trang không.

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.

Use valid values for ARIA attributes

Invalid attribute values cause ARIA properties to be ignored or misinterpreted by assistive technologies, leading to a broken or confusing user experience.

Quick Reference

  • Ensure ARIA attribute values (like aria-expanded="true") are valid
  • Avoid using "yes/no" where "true/false" is required
  • Check that IDs referenced in aria-labelledby or aria-owns actually exist

Check

Validate that all ARIA attribute values conform to the allowed types (boolean, integer, ID list, etc.).

Fix

Correct any invalid ARIA attribute values to match the expected format defined in the ARIA specification.

Explain

Explain why precise attribute values are necessary for browsers to correctly communicate element states to assistive technology.

Code Review

Review the rendered markup and interactive states that affect Use valid values for ARIA attributes. 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/aria-valid-attr-value

Câu hỏi thường gặp

Giá trị sai thường gặp là gì?

Skill đưa ví dụ là yes hoặc no trong khi phải dùng true hoặc false.

Vì sao tham chiếu ID lại quan trọng?

Nếu ID trong aria-labelledby không tồn tại, nhãn bị mất và trình đọc màn hình không dùng được nó.

Skill này có kiểm tra cả tên thuộc tính không?

Không. Tên thuộc tính được kiểm tra riêng ở một bước khác.

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 Use valid values for ARIA attributes. Check native semantics first, then inspect keyboard behavior, focus flow, accessible names, and screen-reader output where relevant.

repo: thedaviddias/Front-End-Checklist

Độ phổ biến

Sao GitHub
75k
Vị trí xếp hạng
#2742
Giấy phép
MIT
Cập nhật
31/10/2026

Skill này có hữu ích không?

0

Đăng nhập để bình chọn.

Bình luận

  • …

Thêm skill từ kho mã này

Skill tương tự