SwiftUI.js
Components

DefaultScrollAnchor

DefaultScrollAnchor adapts SwiftUI's `defaultScrollAnchor` modifier into an explicit wrapper.

DefaultScrollAnchor adapts SwiftUI's `defaultScrollAnchor` modifier into an explicit wrapper.

Examples

Top

Preview unavailable for this example in the static docs build.

Show code
<DefaultScrollAnchor anchor="top">
      <Text>Start scrolled to the leading edge</Text>
    </DefaultScrollAnchor>

Variants

Preview unavailable for this example in the static docs build.

Show code
<VStack spacing={12}>
      <DefaultScrollAnchor anchor="center">
        <Text>Center content on first presentation</Text>
      </DefaultScrollAnchor>
      <DefaultScrollAnchor anchor="bottom">
        <Text>Pin the latest content to the bottom</Text>
      </DefaultScrollAnchor>
    </VStack>

API

PropTypeRequiredDescription
anchor'top' | 'center' | 'bottom' | 'leading' | 'trailing'NoNo description yet.

Inherits additional props from IBaseComponent.

Overview

DefaultScrollAnchor adapts SwiftUI's defaultScrollAnchor modifier into an explicit wrapper.

Status: adapted

On this page