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
| Name | Type | Default | Description |
|---|---|---|---|
| axis | ScrollAreaAxis | .vertical | Scroll direction: .vertical, .horizontal, .both. |
| showsIndicators | Bool | true | Whether to show scroll indicators. |
| maxHeight | CGFloat? | nil | Optional maximum height for the scroll area. |