<!--
{
  "availability" : [
    "iOS: 15.0.0 -",
    "iPadOS: 15.0.0 -",
    "macCatalyst: 15.0.0 -",
    "macOS: 12.0.0 -",
    "tvOS: 15.0.0 -",
    "visionOS: 1.0.0 -",
    "watchOS: 8.0.0 -"
  ],
  "documentType" : "symbol",
  "framework" : "SwiftUI",
  "identifier" : "/documentation/SwiftUI/View/accessibilityHeading(_:)",
  "metadataVersion" : "0.1.0",
  "role" : "Instance Method",
  "symbol" : {
    "kind" : "Instance Method",
    "modules" : [
      "SwiftUI"
    ],
    "preciseIdentifier" : "s:7SwiftUI4ViewPAAE20accessibilityHeadingyAA15ModifiedContentVyxAA31AccessibilityAttachmentModifierVGAA0hE5LevelOF"
  },
  "title" : "accessibilityHeading(_:)"
}
-->

# accessibilityHeading(_:)

Sets the accessibility level of this heading.

```
nonisolated func accessibilityHeading(_ level: AccessibilityHeadingLevel) -> ModifiedContent<Self, AccessibilityAttachmentModifier>
```

## Parameters

`level`

The heading level to associate with this element
from the available [`AccessibilityHeadingLevel`](/documentation/SwiftUI/AccessibilityHeadingLevel) levels.

## Discussion

Use this modifier to set the level of this heading in relation to other headings. The system speaks
the level number of levels [`AccessibilityHeadingLevel.h1`](/documentation/SwiftUI/AccessibilityHeadingLevel/h1) through
[`AccessibilityHeadingLevel.h6`](/documentation/SwiftUI/AccessibilityHeadingLevel/h6) alongside the text.

The default heading level if you don’t use this modifier
is [`AccessibilityHeadingLevel.unspecified`](/documentation/SwiftUI/AccessibilityHeadingLevel/unspecified).

---

Copyright &copy; 2026 Apple Inc. All rights reserved. | [Terms of Use](https://www.apple.com/legal/internet-services/terms/site.html) | [Privacy Policy](https://www.apple.com/privacy/privacy-policy)