<!--
{
  "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/accessibilityRotor(_:entries:entryID:entryLabel:)-4qsb1",
  "metadataVersion" : "0.1.0",
  "role" : "Instance Method",
  "symbol" : {
    "kind" : "Instance Method",
    "modules" : [
      "SwiftUI"
    ],
    "preciseIdentifier" : "s:7SwiftUI4ViewPAAE18accessibilityRotor_7entries7entryID0G5LabelQrAA18LocalizedStringKeyV_Sayqd__Gs0L4PathCyqd__qd_0_GALyqd__SSGtSHRd_0_r0_lF"
  },
  "title" : "accessibilityRotor(_:entries:entryID:entryLabel:)"
}
-->

# accessibilityRotor(_:entries:entryID:entryLabel:)

Create an Accessibility Rotor with the specified user-visible label
and entries.

```
nonisolated func accessibilityRotor<EntryModel, ID>(_ rotorLabelKey: LocalizedStringKey, entries: [EntryModel], entryID: KeyPath<EntryModel, ID>, entryLabel: KeyPath<EntryModel, String>) -> some View where ID : Hashable
```

## Parameters

`rotorLabelKey`

Localized label identifying this Rotor to the user.

`entries`

An array of values that will be used to generate
the entries of the Rotor.

`entryID`

Key path on the entry type that can be used
to generate an identifier for the Entry. The identifiers
must match up with identifiers in `ForEach` or explicit `id` calls
within the `ScrollView`.

`entryLabel`

Key path on the entry type that can be
used to get a user-visible label for every Rotor entry. This is used
on macOS when the user opens the list of entries for the Rotor.

## Discussion

An Accessibility Rotor is a shortcut for Accessibility users to
quickly navigate to specific elements of the user interface,
and optionally specific ranges of text within those elements.

Using this modifier requires that the Rotor be attached to a
`ScrollView`, or an Accessibility Element directly within a
`ScrollView`, such as a `ForEach`. When the user navigates to entries
from this Rotor, SwiftUI will automatically scroll them into place as
needed.

In the following example, a Message application creates a Rotor
allowing users to navigate to specifically the messages originating from
VIPs.

```
// `messages` is a list of `Message`s that have a `subject` and a
// `uuid`. `vipMesages` is a filtered version of that list
// containing only messages from VIPs.
ScrollView {
    LazyVStack {
        ForEach(messages) { message in
            MessageView(message)
        }
    }
}
.accessibilityElement(children: .contain)
.accessibilityRotor("VIPs", entries: vipMessages,
    entryID: \.uuid, entryLabel: \.subject)
```

---

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)