Skip to main content
type Axis =
  | "horizontal"
  | "vertical"
  | "both";

Values

horizontal
string
The horizontal axis. Content flows or scrolls left to right (or right to left in RTL languages).
vertical
string
The vertical axis. Content flows or scrolls top to bottom.
both
string
Both horizontal and vertical axes. Content can scroll in both directions.

Usage

// Horizontal scrolling
ScrollView({ axis: "horizontal" }, [
  HStack([
    Text("Item 1"),
    Text("Item 2"),
    Text("Item 3")
  ])
])

// Vertical scrolling (default)
ScrollView({ axis: "vertical" }, [
  VStack([
    Text("Item 1"),
    Text("Item 2"),
    Text("Item 3")
  ])
])

// Both directions
ScrollView({ axis: "both" }, [
  // Large content that can scroll horizontally and vertically
])