OneScript

ScrollView

Scroll content vertically, horizontally, or in both directions.

ScrollView displays content in a scrollable region. It also accepts Modifiers.

import { Modifier, ScrollView, Text, VStack } from "onescript/views"

<ScrollView
  showsIndicators={false}
  modifier={Modifier.padding(12)}
>
  <VStack
    alignment="leading"
    spacing={12}
  >
    {items.map(item => <Text key={item.id}>{item.title}</Text>)}
  </VStack>
</ScrollView>
PropTypeDescription
axes"vertical" | "horizontal" | "all"Allowed scrolling directions. Defaults to "vertical".
showsIndicatorsbooleanWhether the system displays scroll indicators. Defaults to true.
childrenview or view arrayViews placed in the scrollable content region.

Scrolling is interactive in App and Action view sessions. Widget rendering is static and displays the currently visible region.

How is this guide?

Last updated on