accessibilityHeading

Sets the accessibility level of this heading.

View ModifieriOS 15.0+macOS 12.0+tvOS 15.0+watchOS 8.0+accessibilityHeading(_:) in SwiftUI

Declaration

React
compose().accessibilityHeading(
  level: SwiftUI.AccessibilityHeadingLevel
)
Swift
nonisolated func accessibilityHeading(
    _ level: AccessibilityHeadingLevel
) -> ModifiedContent<Self, AccessibilityAttachmentModifier>

Parameters

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 through AccessibilityHeadingLevel.h6 alongside the text.

The default heading level if you don’t use this modifier is AccessibilityHeadingLevel.unspecified.

See also

More in Accessibility.