0.0.1 • Published 4 years ago

react-native-stretchable-header v0.0.1

Weekly downloads
4
License
MIT
Repository
github
Last release
4 years ago

license

React Native Stretchable Header

A React Native scrollable stretchable header component. Works on iOS & Android.

Preview

rn-stretchable-header-2.gif

Installation

npm install react-native-stretchable-header --save

Usage

Import StretchableHeader component:

import StretchableHeader from 'react-native-stretchable-header';
<StretchableHeader
  headerImageHeight={350}
  headerImageSource={require('./image.jpg')}
  contentView={renderContentView()}
/>

Configuration

proptype/valid valuesdefaultdescription
headerImageHeightnumber100Height of header image
headerImageSourceImageSourcePropTypenullStretchable header image RN image source
contentViewReactElement100Height of header image

Scrolling Animation

You can use animatedValueScrollY for using the scrolling animation value of content offset Y.

import StretchableHeader, {animatedValueScrollY} from 'react-native-stretchable-header';

With Navigation Bar

For instance, if you want to create navigation bar like preview below:

rn-stretchable-header.gif

You can copy and use TopNavigation from Example. Customize it based on your needs.

Demo Application

This repository contains a demo React Native application with a customizable example of the StretchableHeader component in use.

To use the demo application:

1) Clone this repository: https://github.com/iqbalansyor/react-native-stretchable-header.git 2) Navigate to the demo application: cd path/to/this/repository/react-native-stretchable-header/Example 3) Install demo application dependencies: npm install 4) For ios, run cd ios && pod install && cd .. 5) Run npm run start || react-native run-android || react-native run-ios

Contact me

Contributing

Feel free to try it out. Please submit a pull request with any features/fixes for the project.

License

This project is licensed under the MIT License - see the MIT Open Source Initiative for details.