Skip to main content
🎉 A11y Issue Detection Agent is now live! Detect accessibility issues like a WCAG expert with AI. Try now!
No Result Found
Connect and get help from 7,000+ developers on our Discord community. Ask the CommunityAsk the Community

Missing heading

Screen reader users rely on headings to navigate app content. However, if an app uses visual styling (font size, bold text, spacing) to suggest headings without programmatically marking them as headings, screen reader users cannot identify or navigate the content structure. This rule ensures that text elements visually functioning as headings are programmatically marked.

  • Rule Category: Content Structure
  • Rule Severity: Moderate
  • WCAG 2.1 & 2.2 SC: 1.3.1 (A), 2.4.6 (AA)
  • Supported Platforms: Android, iOS

Success criteria

The rule checks for the following:

  • Text elements that visually function as section headings must be programmatically marked as a heading.

AI-powered testing

BrowserStack provides an AI-powered Issue Detection Agent that analyzes app screenshots and element properties to identify text that visually functions as a heading but lacks the semantic heading trait. If a heading is missing, the agent provides contextual reasoning and an actionable suggestion to fix the issue.

AI-powered results are clearly marked in the report so you can review and apply suggestions as needed.

The Issue Detection Agent performs the following checks:

  • Detects missing headings
    1. Identifies text elements with visual heading characteristics that are not programmatically marked as headings. The Issue Detection Agent checks for the following:
      • Larger font size compared to surrounding text.
      • Bold or emphasized text style.
      • Spatial separation from a block of text.
      • Text positioned at the start of sections, cards, or groups.
    2. The Issue Detection Agent takes the context into consideration and does not detect text elements that are purely decorative or promotional, or interactive elements such as buttons, links, or tab-bar icons, even if they are visually prominent.
    3. Confirms whether the heading trait is programmatically applied by checking element properties.
  • Provides explanation
    • Explains why the element was flagged and why it should be marked as a heading.

For more information about the Issue Detection Agent, see Issue Detection Agent.

How to fix

To resolve missing heading violations, manually mark the text element as a heading using the appropriate framework attribute:

  • To mark a text element as a heading on Android, add the android:accessibilityHeading="true" attribute to the view in your layout XML.
  • To mark a text element as a heading on iOS, add the UIAccessibilityTraitHeader trait using either UIKit or SwiftUI
  • To mark a text element as a heading in React Native, set the accessibilityRole prop to "header".
  • To mark a text element as a heading in Flutter, wrap it with a Semantics widget and set header: true.

Example

The following screenshot shows missing heading violations in an Android app:

Missing heading violation showing two text elements that visually function as headings but lack the heading semantic trait.

Error

  • In this example, the text element “Another heading!” visually introduces a new section but is not programmatically marked as a heading. The element’s heading trait is set to false, isHeading: false. As a result, screen readers cannot recognize this text as a structural heading and will not announce it as a heading or make it available for navigation.

Fix

  • To fix this violation, ensure the text element is programmatically marked as a heading. In this example, set the Android heading attribute, android:accessibilityHeading for the text element to true.

References

We're sorry to hear that. Please share your feedback so we can do better

Contact our Support team for immediate help while we work on improving our docs.

We're continuously improving our docs. We'd love to know what you liked





Thank you for your valuable feedback

Is this page helping you?

Yes
No

We're sorry to hear that. Please share your feedback so we can do better

Contact our Support team for immediate help while we work on improving our docs.

We're continuously improving our docs. We'd love to know what you liked





Thank you for your valuable feedback!

Talk to an Expert
Download Copy Check Circle