ScrollView
Provide the viewport for a scrollable page.
<View layout={{ flex: 1 }}> <Text>Trail itinerary</Text> <ScrollView> <ScrollViewContent> {stops} </ScrollViewContent> </ScrollView></View>Place a single ScrollViewContent directly inside the viewport. The viewport defaults to flex: 1 and clips overflowing content. Give its parent a bounded height so that content extending beyond the viewport can scroll.
Scroll several sections together
Give the content padding when the first and last sections need space at the edges. That padding moves with the paragraphs as the reader scrolls.
import { ScrollView, ScrollViewContent, Text } from 'react-nitro-renderer'
type Paragraph = { id: string; text: string }
export function NoteBody({ paragraphs }: { paragraphs: Paragraph[] }) {
return (
<ScrollView layout={{ flex: 1 }}>
<ScrollViewContent layout={{ padding: 20 }}>
{paragraphs.map((paragraph) => (
<Text key={paragraph.id} layout={{ marginBottom: 12 }}>{paragraph.text}</Text>
))}
</ScrollViewContent>
</ScrollView>
)
}Place a header or toolbar beside the ScrollView in the outer layout to keep it fixed. Put it inside ScrollViewContent if it should scroll away with the page.
Use this layout for an article, form, or short collection where you want every child in the view tree. For a long feed, give List its own bounded viewport so its native host can recycle rows. ScrollViewContent · List