<!--
{
  "availability" : [
    "iOS: 14.0.0 -",
    "iPadOS: 14.0.0 -",
    "macCatalyst: 14.0.0 -",
    "macOS: 11.0.0 -",
    "tvOS: 14.0.0 -",
    "visionOS: 1.0.0 -",
    "watchOS: 7.0.0 -"
  ],
  "documentType" : "symbol",
  "framework" : "SwiftUI",
  "identifier" : "/documentation/SwiftUI/View/accessibilityLabeledPair(role:id:in:)",
  "metadataVersion" : "0.1.0",
  "role" : "Instance Method",
  "symbol" : {
    "kind" : "Instance Method",
    "modules" : [
      "SwiftUI"
    ],
    "preciseIdentifier" : "s:7SwiftUI4ViewPAAE24accessibilityLabeledPair4role2id2inQrAA013AccessibilityeF4RoleO_qd__AA9NamespaceV2IDVtSHRd__lF"
  },
  "title" : "accessibilityLabeledPair(role:id:in:)"
}
-->

# accessibilityLabeledPair(role:id:in:)

Pairs an accessibility element representing a label with the element
for the matching content.

```
nonisolated func accessibilityLabeledPair<ID>(role: AccessibilityLabeledPairRole, id: ID, in namespace: Namespace.ID) -> some View where ID : Hashable
```

## Parameters

`role`

Determines whether this element should be used as the label
in the pair, or the content in the pair.

`id`

The identifier for the label / content pair. Elements with
matching identifiers within the same namespace will be paired
together.

`namespace`

The namespace used to organize label and content. Label
and content under the same namespace with matching identifiers will
be paired together.

## Discussion

Use `accessibilityLabeledPair` with a role of `AccessibilityLabeledPairRole.label`
to identify the label, and a role of `AccessibilityLabeledPairRole.content`
to identify the content.
This improves the behavior of accessibility features such as VoiceOver
when navigating such elements, allowing users to better understand the
relationship between them.

---

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)