accessibilityLinkedGroup(id:in:)
Links multiple accessibility elements so that the user can quickly navigate from one element to another, even when the elements are not near each other in the accessibility hierarchy.
Declaration
nonisolated func accessibilityLinkedGroup<ID>(id: ID, in namespace: Namespace.ID) -> some View where ID : Hashable
Parameters
- id:
A hashable identifier used to separate sets of linked elements within the same namespace. Elements with matching
namespaceandidwill be linked together. - namespace:
The namespace to use to organize linked accessibility elements. All elements marked with
accessibilityLinkedGroupin this namespace and with the specifiedidwill be linked together.
Discussion
This can be useful to allow quickly jumping between content in a list and the same content shown in a detail view, for example. All elements marked with accessibilityLinkedGroup with the same namespace and identifier will be linked together.
When all elements in the linked group are text views (Text, TextEditor, or TextField), VoiceOver treats the group as a single text element — line, word, and character navigation moves across element boundaries as if the views form one continuous text region. On macOS, this unified text navigation uses shared text UI elements. If any element in the group is not a text view, the standard linking behavior applies.