---
title: "accessibilityLabeledPair(role:id:in:)"
framework: swiftui
role: symbol
role_heading: Instance Method
path: "swiftui/view/accessibilitylabeledpair(role:id:in:)"
---

# accessibilityLabeledPair(role:id:in:)

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

## Declaration

```swift
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

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.

## See Also

### Applying labels

- [accessibilityLabel(_:)](swiftui/view/accessibilitylabel(_:).md)
- [accessibilityLabel(_:isEnabled:)](swiftui/view/accessibilitylabel(_:isenabled:).md)
- [accessibilityLabel(content:)](swiftui/view/accessibilitylabel(content:).md)
- [accessibilityInputLabels(_:)](swiftui/view/accessibilityinputlabels(_:).md)
- [accessibilityInputLabels(_:isEnabled:)](swiftui/view/accessibilityinputlabels(_:isenabled:).md)
- [AccessibilityLabeledPairRole](swiftui/accessibilitylabeledpairrole.md)
