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

aria-dialog-name

Skill này làm gì

Skill này kiểm tra xem cửa sổ bật lên như modal và hộp thoại cảnh báo có tên khả năng tiếp cận không. Nó dành cho lập trình viên làm cửa sổ bật lên và hộp xác nhận.

Khi nào nên dùng

  • ✓Khi bạn làm modal, cửa sổ bật lên hoặc hộp thoại xác nhận.
  • ✓Khi một hộp thoại mở mà không có tiêu đề rõ ràng cho trình đọc màn hình.
  • ✓Khi bạn xem lại các thành phần hộp thoại dùng chung.

Liên kết skill

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

“Đảm bảo hộp đồng ý cookie và hộp xác nhận xóa có tên để 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 phần tử hộp thoại có tên hay không, thường bằng cách trỏ aria-labelledby đến tiêu đề của nó, hoặc thêm một aria-label rõ rà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.

Ensure dialogs have an accessible name

When a dialog opens, screen readers should announce its purpose immediately so users know why their focus has shifted and what information is required.

Quick Reference

  • All dialog and alertdialog elements must have a descriptive label
  • Use aria-labelledby to point to a title or aria-label for a direct string
  • Helps users understand the context and purpose of the modal

Check

Verify that every element with role="dialog" or role="alertdialog" has an accessible name.

Fix

Provide an accessible name for the dialog using aria-labelledby (pointing to the header) or aria-label.

Explain

Explain why naming dialogs is crucial for orienting screen reader users when modals appear.

Code Review

Review the rendered markup and interactive states that affect Ensure dialogs have an accessible name. 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-dialog-name

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

Vì sao hộp thoại cần có tên?

Skill nói trình đọc màn hình nên thông báo mục đích của hộp thoại ngay khi nó mở.

Nên dùng aria-labelledby hay aria-label?

Dùng aria-labelledby để trỏ đến một tiêu đề nhìn thấy được, hoặc aria-label cho một chuỗi văn bản ngắn.

Điều này có áp dụng cho hộp thoại cảnh báo không?

Có. Skill bao quát cả vai trò dialog và alertdialog.

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 Ensure dialogs have an accessible name. 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
#2726
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ự