View Source ScrollView

<ScrollView>

A view that lets it contents be scrolled if larger than the available space.

Overview

<ScrollView>
    <VStack>
        <%= for color <- @colors %>
            <Rectangle id={color} fillColor={color} class="height:100" />
        <% end %>
    </VStack>
</ScrollView>

Attributes

SwiftUI Documentation

See SwiftUI.ScrollView for more details on this View.

References

Which axes this view is scrollable along (defaults to vertical).

When the scroll view appears, and whenever this attribute changes, it will scroll to the view with the corresponding id attribute.

Discussion

The scrollPositionAnchor attribute governs where in the scroll view the target will be positioned.

Link to this reference

scrollPositionAnchor

Where in the scroll view the view that is being scrolled to is positioned.

Discussion

For example, specifying top will scroll the target to be at the top of the scroll view. See UnitPoint for how values can be specified.

Link to this reference

showsIndicators

Whether the scroll indicators are shown (defaults to true).