React Nitro

ScrollViewContent

Lay out the children that move together inside a ScrollView.

App.tsx
<ScrollView>  <ScrollViewContent    layout={{ padding: 0 }}  >    {stops}  </ScrollViewContent></ScrollView>
Trail itinerary

Station garden

Orchard gate

Willow bridge

Old mill

Riverside path

North meadow

Hilltop bench

Lake shore

Add an inset, then scroll. The padding travels with the contents of the viewport.

Use ScrollViewContent as the direct and only child of ScrollView. Put every section you want to scroll inside it. The measured content determines how far the user can scroll.

import { ScrollView, ScrollViewContent, Text } from 'react-nitro-renderer'

export function NotePage({ body }: { body: string }) {
  return (
    <ScrollView>
      <ScrollViewContent layout={{ padding: 20 }}>
        <Text fontWeight="bold">Field notes</Text>
        <Text>{body}</Text>
      </ScrollViewContent>
    </ScrollView>
  )
}

Here the 20-point padding scrolls with the text. Place a fixed header outside the ScrollView when it should stay on screen. ScrollView