---
title: ScrollAnchorRole
framework: swiftui
role: symbol
role_heading: Structure
path: swiftui/scrollanchorrole
---

# ScrollAnchorRole

A type defining the role of a scroll anchor.

## Declaration

```swift
struct ScrollAnchorRole
```

## Overview

Overview You can associate a UnitPoint to a ScrollView using the defaultScrollAnchor(_:) modifier. By default, the system uses this point for different kinds of behaviors including: Where the scroll view should initially be scrolled How the scroll view should handle content size or container size changes How the scroll view should align content smaller than its container size You can further customize this behavior by assigning different unit points for these different roles.

## Topics

### Type Properties

- [alignment](swiftui/scrollanchorrole/alignment.md)
- [initialOffset](swiftui/scrollanchorrole/initialoffset.md)
- [sizeChanges](swiftui/scrollanchorrole/sizechanges.md)

## Relationships

### Conforms To

- [Equatable](swift/equatable.md)
- [Hashable](swift/hashable.md)
- [Sendable](swift/sendable.md)
- [SendableMetatype](swift/sendablemetatype.md)

## See Also

### Managing scroll position

- [scrollPosition(_:anchor:)](swiftui/view/scrollposition(_:anchor:).md)
- [scrollPosition(id:anchor:)](swiftui/view/scrollposition(id:anchor:).md)
- [defaultScrollAnchor(_:)](swiftui/view/defaultscrollanchor(_:).md)
- [defaultScrollAnchor(_:for:)](swiftui/view/defaultscrollanchor(_:for:).md)
- [ScrollPosition](swiftui/scrollposition.md)
