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

aria-roles

Skill này làm gì

Skill này kiểm tra xem giá trị vai trò ARIA có hợp lệ và viết đúng chính tả hay không. Nó dành cho lập trình viên thêm vai trò vào thành phần tùy chỉnh hoặc template.

Khi nào nên dùng

  • ✓Khi bạn thêm thuộc tính role vào một phần tử tùy chỉnh.
  • ✓Khi một vai trò dường như không có tác dụng trên trang.
  • ✓Khi bạn xem lại đánh dấu dùng tên vai trò tùy chỉnh hoặc khác thường.

Liên kết skill

https://github.com/thedaviddias/Front-End-Checklist/blob/main/skills/aria-roles/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-roles/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

“Tìm các thuộc tính role bị viết sai hoặc không chuẩn trong template của tôi và sửa chúng.”

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

Cách hoạt động

Agent tìm các giá trị vai trò không có trong danh sách chuẩn, sửa chúng, và gợi ý một điều khiển HTML gốc khi điều đó đơn giản hơ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.

Use valid ARIA role values

Invalid or misspelled ARIA roles are ignored by browsers and assistive technologies, rendering the intended accessibility features useless and potentially confusing users.

Quick Reference

  • Use only standard ARIA roles defined in the W3C specification
  • Avoid typos or non-existent roles (e.g., use checkbox, not check-box)
  • Ensure roles are applied to appropriate HTML elements
  • Prefer native HTML controls over custom ARIA widgets whenever possible

Check

Search for any role attributes that use non-standard or misspelled ARIA role values.

Fix

Replace invalid ARIA roles with the correct, standard values from the WAI-ARIA specification. When a native <button>, <input>, <select>, or other semantic element can replace the custom widget, prefer that change over adding more ARIA.

Explain

Explain why using standardized ARIA roles is critical for ensuring that assistive technologies can interpret and announce elements correctly, and why native HTML controls are usually more reliable than recreating them with ARIA.

Code Review

Review the rendered markup and interactive states that affect Use valid ARIA role values. 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-roles

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

Vai trò viết sai bị xử lý thế nào?

Skill nói nó bị bỏ qua, nên tính năng khả năng tiếp cận dự định sẽ không hoạt động.

Có nên dùng ARIA cho điều khiển tùy chỉnh không?

Skill khuyến nghị dùng điều khiển HTML gốc như button hoặc select trước, khi chúng có thể làm việc đó.

Bạn có thể cho một ví dụ lỗi không?

Skill đưa check-box thay cho checkbox làm ví dụ về vai trò không hợp lệ.

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 ARIA role values. 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
#2737
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ự