<!--
{
  "availability" : [
    "iOS: 26.0.0 -",
    "iPadOS: 26.0.0 -",
    "macCatalyst: 26.0.0 -",
    "visionOS: 26.0.0 -",
    "watchOS: 26.0.0 -"
  ],
  "documentType" : "symbol",
  "framework" : "SwiftUI",
  "identifier" : "/documentation/SwiftUI/View/listSectionIndexVisibility(_:)",
  "metadataVersion" : "0.1.0",
  "role" : "Instance Method",
  "symbol" : {
    "kind" : "Instance Method",
    "modules" : [
      "SwiftUI"
    ],
    "preciseIdentifier" : "s:7SwiftUI4ViewPAAE26listSectionIndexVisibilityyQrAA0G0OF"
  },
  "title" : "listSectionIndexVisibility(_:)"
}
-->

# listSectionIndexVisibility(_:)

Changes the visibility of the list section index.

```
nonisolated func listSectionIndexVisibility(_ visibility: Visibility) -> some View
```

## Parameters

`visibility`

The visibility of the list section index.

## Discussion

The section index shows the section index labels of sections, which are
set using the `sectionIndexLabel` modifier. These are typically the
letters of the alphabet, used for sorted sections.

```
List(sections) { section in
    Section(section.title) {
        ForEach(section.rows) { row in
            // ...
        }
    }
    .sectionIndexLabel(section.indexTitle)
}
.listSectionIndexVisibility(.visible)
```

On iOS, the section index is displayed as a number of vertically stacked
letters on the trailing side of the list. Users can jump to a specific
section in the list by tapping on the corresponding index label.

![A list on iOS showing alphabetically sorted contact details, with a
section index](Example_iOS.png)

On watchOS, the index of the section currently visible is displayed next
to the scroll indicator when the user is scrolling through the list
using the crown.

![A list on watchOS showing an alphabetically sorted list of sporst,
with a section index](Example_iOS.png)

By default, the list section index is visible if the list contains any
sections with an index label.

The index only shows labels for sections with a `sectionIndexLabel`
modifier. This can be used to hide certain sections from the index.

By hiding section headers of empty sections with an index label, a list
section index can be made to show index labels without a corresponding
section.

---

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)