Docs
Components/Layout/ScrollArea

ScrollArea

Styled scrollable container with configurable axes.

s0 add scroll-area

Usage

S0.ScrollArea(maxHeight: 300) {
    VStack {
        ForEach(items) { item in
            Text(item.name)
        }
    }
}
S0.ScrollArea(axis: .horizontal, showsIndicators: false) {
    HStack(spacing: 12) {
        ForEach(images) { img in
            Image(img.name)
        }
    }
}

Parameters

NameTypeDefaultDescription
axisScrollAreaAxis.verticalScroll direction: .vertical, .horizontal, .both.
showsIndicatorsBooltrueWhether to show scroll indicators.
maxHeightCGFloat?nilOptional maximum height for the scroll area.