0.5.9 • Published 3 years ago

@roshangm1/react-native-header-scrollview v0.5.9

Weekly downloads
-
License
MIT
Repository
github
Last release
3 years ago

@roshangm1/react-native-header-scrollview

Header ScrollView/FlatList for react native.

Features

  • Typescript
  • Works with Expo
  • Reanimated v2 (on >0.4.0)
  • Flatlist support (with tweaks)

Installation

To use with Animated from react native, use <= 0.4.0

yarn add @roshangm1/react-native-header-scrollview@0.4.0

To use with react-native-reanimated@v2, use >0.4.0 (latest)

Make sure that you have installed React Native Reanimated V2 properly.

yarn add @roshangm1/react-native-header-scrollview

Usage

Scrollview

import HeaderScrollview from '@roshangm1/react-native-header-scrollview';

// ...

return <HeaderScrollview title="Hello">content...</HeaderScrollview>;

Flatlist

  const data = [
    { id: 'header' }, // first index act as a header so always prepend extra item to your data
    { id: 1 },
    { id: 2 },
    { id: 3 },
    { id: 4 },
    { id: 5 },
    { id: 6 },
    { id: 7 },
    { id: 8 },
  ];

return (
  <HeaderScrollview
    title="Hellow world"
    useFlatlist={true}
    flatListProps={{
      data: data,
      keyExtractor: (item) => item.id.toString(),
    }}
    ....
  />
);

Please check example for implementation detail. Or you can refer to this snack from the link below. Note that, this doesn't run in web.

Header Scrollview Example

Props

Only required prop:

PropTypeDescription
titlestringThe title of the header. This will show up as large text inside the scroll view and then fade in as the smaller text inside the header.

From there, you can customize this component to get exactly what you want.

PropTypeDescription
titleStyleReact Native style or ObjectStyles the large header title component inside the scroll view.
containerStyleReact Native style or ObjectStyles the entire container wrapping the header and the scrollview.
headerContainerStyleReact Native style or ObjectStyles the container of the header component that appears after scrolling.
headerComponentContainerStyleReact Native style or ObjectStyles the component inside the header. Anything within this style will fade in and out as the scroll position changes.
headlineStyleReact Native style or ObjectStyles the header text inside the header that appears after scrolling.
scrollContainerStyleReact Native style or ObjectStyles the scroll view component.
useFlatlistStringUse Flatlist instead of ScrollView,
scrollViewPropsObjectPass any extra props to the scrollView.

Contributing

See the contributing guide to learn how to contribute to the repository and the development workflow.

License

MIT

This project is the custom fork of this repository which is not maintained now.

0.5.8

3 years ago

0.5.9

3 years ago

0.5.7

3 years ago

0.5.4

3 years ago

0.5.3

3 years ago

0.5.6

3 years ago

0.5.5

3 years ago

0.5.2

3 years ago

0.5.1

3 years ago

1.0.1

3 years ago

1.0.0

3 years ago

0.5.0

3 years ago

0.4.0

3 years ago

0.3.8

3 years ago

0.3.7

3 years ago

0.3.6

3 years ago

0.3.5

3 years ago

0.3.4

3 years ago

0.3.3

3 years ago

0.3.2

3 years ago

0.3.1

3 years ago

0.3.0

3 years ago

0.2.0

3 years ago

0.1.0

3 years ago