React Native MantineMiscellaneous

Scroller

Horizontal scroller with edge gradients and controls

Import: import { Scroller } from 'react-native-mantine';

Usage

import { Scroller } from 'react-native-mantine';

// Controls appear once content overflows
<Scroller scrollAmount={200} controlSize={32}>
  {items.map((item) => (
    <Badge key={item}>{item}</Badge>
  ))}
</Scroller>

// Edge gradients only, no control buttons
<Scroller withControls={false}>
  {/* ... */}
</Scroller>

Props

PropTypeDefaultDescription
childrenReactNodeScrollable content
scrollAmountnumber200Number of px scrolled when a control is pressed
controlSizenumber32Size of the scroll controls in px
edgeGradientColorstringColor of the edge gradients, defaults to theme background
withEdgeGradientsbooleantrueDetermines whether the edge gradients should be displayed
withControlsbooleantrueDetermines whether the scroll controls should be displayed
startControlIconReactNodeIcon of the start control
endControlIconReactNodeIcon of the end control
startControlLabelstring"Scroll back"Start control accessibility label
endControlLabelstring"Scroll forward"End control accessibility label

Source on GitHub · npm