ScrollView

Cross-platform ScrollView with Tamagui props

ScrollView brings the React Native scrolling API and Tamagui style props to native and web without a react-native-web dependency.

Features

  • React Native ScrollView API

  • Web implementation with no react-native-web

  • Full Tamagui style props

In v3, @tamagui/scroll-view ships its own web implementation instead of wrapping react-native-web. It supports the ScrollView surface Tamagui uses most: scrollTo, scrollToEnd, getScrollableNode, React Native-shaped onScroll, contentContainerStyle, horizontal, and scroll indicator props.

Props outside that mapped surface, such as momentum events, snapTo*, and keyboardDismissMode, are not supported on web through the lite implementation.

Installation

ScrollView is already installed in tamagui, or you can install it independently:

yarn add @tamagui/scroll-view

Usage

import { ListItem, ScrollView, YStack, style } from 'tamagui'
const contentContainer = style({
padding: 16,
gap: 8,
})
export default () => (
<ScrollView contentContainerStyle={contentContainer}>
<YStack>
<ListItem>1</ListItem>
<ListItem>2</ListItem>
<ListItem>3</ListItem>
<ListItem>4</ListItem>
</YStack>
</ScrollView>
)

API reference

ScrollView

ScrollView accepts Tamagui standard props and the mapped React Native ScrollView surface.

Props

  • contentContainerStyle

    StylePiece

    Styles applied to the inner scroll container. Accepts a style() piece.

  • horizontal

    boolean

    When true, scrolls horizontally instead of vertically.

  • showsHorizontalScrollIndicator

    boolean

    Whether to show the horizontal scroll indicator.

  • showsVerticalScrollIndicator

    boolean

    Whether to show the vertical scroll indicator.

  • See React Native ScrollView and Tamagui style props. On web, prefer the mapped props documented above.