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

aria-toggle-field-name

Skill này làm gì

Skill này kiểm tra xem checkbox, nút radio và công tắc có tên rõ ràng hay không. Skill dành cho lập trình viên xây form và trang cài đặt có các nút bật tắt.

Khi nào nên dùng

  • ✓Khi bạn tạo một checkbox, nút radio hoặc công tắc.
  • ✓Khi một nút bật tắt không có nhãn hiển thị hoặc chỉ có biểu tượng.
  • ✓Khi trang cài đặt có các công tắc chưa được mô tả cho trình đọc màn hình.

Liên kết skill

https://github.com/thedaviddias/Front-End-Checklist/blob/main/skills/aria-toggle-field-name/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-toggle-field-name/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 xem mọi công tắc trên trang cài đặt của tôi đã có tên mà trình đọc màn hình có thể đọc lên chưa.”

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

Cách hoạt động

Agent kiểm tra mỗi nút bật tắt có phần tử label, aria-label hoặc aria-labelledby không, rồi thêm tên rõ ràng nếu thiếu.

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.

Provide accessible names for toggle fields

Toggle fields like checkboxes and switches are unusable for screen reader users if they don't have a label, as the user won't know what they are turning on or off.

Quick Reference

  • Use aria-label, aria-labelledby, or <label> for checkboxes and radios
  • Ensure the label clearly describes the state or action of the toggle
  • Avoid empty or non-descriptive labels for switches

Check

Check all toggle fields (checkboxes, radio buttons, switches) for a valid accessible name.

Fix

Add an accessible name to the toggle field using a label element, aria-label, or aria-labelledby.

Explain

Explain why all interactive toggle controls must have descriptive names for users to understand their purpose.

Code Review

Review the rendered markup and interactive states that affect Provide accessible names for toggle fields. 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-toggle-field-name

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

Vì sao nút bật tắt cần có tên?

Skill nói rằng nếu không có tên, người dùng sẽ không biết mình đang bật hay tắt điều gì.

Những cách nào có thể đặt tên cho nút bật tắt?

Phần tử label, aria-label hoặc aria-labelledby.

Công tắc có cần chú ý đặc biệt không?

Có. Skill cảnh báo không nên để nhãn trống hoặc mơ hồ trên công tắ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 Provide accessible names for toggle fields. 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
#2739
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ự