summary-name-present

Summary elements have an accessible name

automaticWCAG 4.1.2 (A)confidence: highseverity: seriousrobust

Checks that <summary> elements expose a non-empty accessible name.

Applies to. Applies to <summary> elements included in the accessibility tree, wherever they appear, a <summary> outside a <details> is still matched.

Expectation. The element has a non-empty accessible name from aria-label, from an aria-labelledby that resolves to non-empty text, from title, or from its own subtree text, where a descendant's own name (an <img alt>, aria-label or title) counts as that descendant's contribution.

Examples

pass
<details>
<summary>More details</summary>
<p>Body</p>
</details>

Visible text content names the `<summary>`.

fail
<details>
<summary></summary>
<p>Body</p>
</details>

No text content and no accessible name.

View source