SwiftUI.js
Components

ScrollTarget

ScrollTarget marks a stable scroll destination that can be resolved by `ScrollViewReader`.

ScrollTarget marks a stable scroll destination that can be resolved by `ScrollViewReader`.

Examples

Basic Usage

Preview unavailable for this example in the static docs build.

Show code
<ScrollTarget scrollId="chapter-2">{(
      <Card>
        <div style={{ padding: '16px' }}>Scroll target content</div>
      </Card>
    )}</ScrollTarget>

API

PropTypeRequiredDescription
scrollIdstringYesNo description yet.

Inherits additional props from IBaseComponent.

Overview

ScrollTarget marks a stable scroll destination that can be resolved by ScrollViewReader.

Status: adapted

SwiftUI Correspondence: Adapted from SwiftUI's scroll-target identity pattern used with ScrollViewReader.

On this page