1.0.0 • Published 8 months ago

@kanelloc/react-native-animated-header-scroll-view v1.0.0

Weekly downloads
-
License
MIT
Repository
github
Last release
8 months ago

React Native Animated Header ScrollView

NPM version npm npm npm runs with expo

Performant animated scroll view components that:

  • 🔥Support FlatList and ScrollView scrolling interactions.
  • 🔥Animate an image or a custom component into a navbar header
  • 🔥Support bounce animation on scroll down
  • 🔥Support both iOS and Android devices

React Native Animated Header ScrollView

Installation

$ npm install @kanelloc/react-native-animated-header-scroll-view

Usage

import { Card, TopNavBar, HeaderNavBar } from '../components';
import { AnimatedScrollView } from '@kanelloc/react-native-animated-header-scroll-view';
import * as React from 'react';

export const App = () => {
  const data = Array.from(Array(20).keys());
  return (
    <AnimatedScrollView
      HeaderNavbarComponent={<HeaderNavBar />}
      TopNavBarComponent={<TopNavBar />}
      headerImage={require('../../assets/cabin.jpg')}
    >
      {data.map((e) => {
        return <Card item={e} key={e} />;
      })}
    </AnimatedScrollView>
  );
};
import { Card, TopNavBar, HeaderNavBar } from '../components';
import { AnimatedScrollView } from '@kanelloc/react-native-animated-header-scroll-view';
import * as React from 'react';

export const App = () => {
  const data = Array.from(Array(20).keys());
  const renderItem = ({ item }: any) => {
    return (
      <View>
        <Card item={item} />
      </View>
    );
  };

  return (
    <AnimatedFlatList
      headerImage={require('../../assets/cabin.jpg')}
      data={data}
      renderItem={renderItem}
      HeaderNavbarComponent={<HeaderNavBar />}
      TopNavBarComponent={<TopNavBar />}
    />
  );
};

You can find a set of detailed examples here

Also a running snack here

Props

Prop nameDescriptionTypeRequired
TopNavBarComponentRendered on top of the screen as a navbar when scrolling to the topJSX.Elementtrue
HeaderComponentA component to use on top of header image. It can also be used without header image to render a custom component as header.JSX.Elementfalse
HeaderNavbarComponentRendered on top of the header. Transitions to TopNavbarComponent as you scrollJSX.Elementfalse
headerMaxHeightHeight of the header (headerImage or HeaderComponent). Default value is 300numberfalse
topBarHeightHeight of the top navbar. Default value is 90numberfalse
topBarElevationANDROID ONLY Elevation of the top navbar. Default value is 0numberfalse
headerImageImage header sourceImageSourcePropTypefalse
disableScaleDisables header scaling when scrolling. Default value is falsebooleanfalse
imageStyleImage stylesStylePropfalse

Contributing

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

License

MIT

1.0.0

8 months ago

0.12.0

1 year ago

0.9.4

1 year ago

0.9.3

1 year ago

0.11.0

1 year ago

0.10.1

1 year ago

0.11.1

1 year ago

0.10.2

1 year ago

0.10.3

1 year ago

0.10.4

1 year ago

0.10.0

1 year ago

0.9.2

1 year ago

0.9.1

1 year ago

0.9.0

1 year ago

0.8.7

1 year ago

0.8.6

1 year ago

0.8.5

1 year ago

0.8.4

1 year ago

0.8.3

1 year ago

0.8.2

1 year ago

0.8.1

1 year ago

0.8.0

1 year ago

0.7.3

1 year ago

0.7.2

1 year ago

0.7.1

1 year ago

0.7.0

1 year ago

0.6.1

1 year ago

0.6.0

1 year ago

0.5.2

1 year ago

0.5.1

1 year ago

0.5.0

1 year ago

0.4.0

1 year ago

0.3.0

1 year ago

0.2.5

1 year ago

0.2.4

1 year ago

0.2.3

1 year ago

0.2.2

1 year ago

0.2.1

1 year ago

0.2.0

1 year ago