3.0.2 • Published 5 months ago

react-native-indicate v3.0.2

Weekly downloads
5
License
MIT
Repository
github
Last release
5 months ago

react-native-indicate

Enhanced ScrollView with elements indicating scrollable overflow.

Installation

npm i react-native-indicate

Usage

import React from 'react'
import { Text } from 'react-native'
import Indicate from 'react-native-indicate'

export () =>
    <Indicate>
        <Text>Hello Plugin</Text>
    </Indicate>

Options

By default scrolling is enabled for both directions (horizontal and vertical) if there is overflow. The behaviour of Indicate can further be configured with the following props.

PropDescriptionDefaultType
horizontalAllow horizontal scrolling.trueboolean
verticalAllow vertical scrolling.trueboolean
fadeWidthWidth of the fade effect used to indicate overflow.20number
appearanceOffsetIn this range scrollable overflow will be ignored.10number
wrapperStyleAdded to the wrapping SafeAreaView component.nullStyleProp
styleStyles added to the ScrollView.nullStyleProp
innerViewStyleStyles added to the inner ScrollView (both directions).nullStyleProp
contentContainerStylePassed to the ScrollView as well.nullStyleProp
gradientImported image representing a gradient for the left element.nullstring, ImageSourcePropType
anyAll other props passed will be passed down to the ScrollView.nullScrollViewProps

If you need the gradient colored differently, pass a PNG with height 1 pixel and width matching the fadeWidth as the gradient prop. Same format as would be passed to this: <Image source={require('../gradient.png')} />. Support for react-native-linear-gradient (which requires native dependencies) is planned.