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

button-name

Skill này làm gì

Skill này kiểm tra xem mọi nút trên trang có tên mô tả rõ ràng hay không. Skill dành cho lập trình viên xây nút bằng biểu tượng hoặc điều khiển tùy chỉnh.

Khi nào nên dùng

  • ✓Khi bạn thêm nút chỉ có biểu tượng, như biểu tượng đóng hoặc tìm kiếm.
  • ✓Khi trình đọc màn hình chỉ đọc nút là button.
  • ✓Khi một link dẫn sang trang mới nhưng được định dạng như nút.

Liên kết skill

https://github.com/thedaviddias/Front-End-Checklist/blob/main/skills/button-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/button-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 đảm bảo mọi nút biểu tượng trong header website của tôi có tên mà trình đọc màn hình đọc được.”

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 có văn bản nhìn thấy được, aria-label hoặc aria-labelledby không, và thay các nút chỉ dùng để điều hướng bằng link đúng nghĩa.

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 buttons

Buttons without accessible names are announced as 'button' by screen readers, leaving users unable to determine what action will be triggered.

Quick Reference

  • Ensure every <button> has a discernible, descriptive label
  • Use inner text, aria-label, or aria-labelledby for identification
  • Use buttons for actions and state changes, not page navigation
  • Avoid empty buttons or those containing only non-text icons

Check

Scan for buttons that lack descriptive text or accessible labels.

Fix

Add an accessible name to the button using text content, an aria-label, or an aria-labelledby reference. If the element navigates to another URL, replace the button with a link instead of keeping button semantics.

Explain

Explain why accessible names are critical for screen reader users to identify and interact with buttons, and why buttons should trigger actions while links should handle navigation.

Code Review

Review the rendered markup and interactive states that affect Provide accessible names for buttons. 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/button-name

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

Nút không có tên gây ra vấn đề gì?

Skill nói trình đọc màn hình chỉ đọc là button, nên người dùng không biết điều gì sẽ xảy ra.

Khi nào nên dùng link thay thế?

Skill nói nếu phần tử điều hướng tới một URL khác, hãy dùng link thay vì ngữ nghĩa nút.

Nút có thể dùng những loại tên nào?

Văn bản bên trong, aria-label hoặc aria-labelledby.

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 buttons. 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
#2764
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ự