# react-native-stretchable-header

> A React Native scrollable stretchable header component

Latest version **0.0.1** (published 2020-08-07) · MIT license · 0 weekly downloads

## Install

```sh
npm install react-native-stretchable-header
pnpm add react-native-stretchable-header
yarn add react-native-stretchable-header
bun add react-native-stretchable-header
```

## Health

**Score 15/100 (F)** — status: abandoned.

Positive: no vulnerabilities.

Warnings: low downloads; no types; no esm support; pre 1.0.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 0.0.1 |
| Published | 2020-08-07 |
| First published | 2020-08-07 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 2 |
| Unpacked size | 6.8 KB |
| Known vulnerabilities | 0 (+1 in 1 direct dependencies) |
| Install scripts | no |
| GitHub stars | 7 |
| Author | Iqbal Ansyori |
| Maintainers | iqbalansyor |
| Keywords | react native, stretchable header, stretchable, scrollable, ios, android, animation, scrolling |

## Links

- npm: https://www.npmjs.com/package/react-native-stretchable-header
- Repository: https://github.com/iqbalansyor/react-native-stretchable-header
- Issues: https://github.com/iqbalansyor/react-native-stretchable-header/issues
- npm.io page: https://npm.io/package/react-native-stretchable-header

## Dependencies (2)

- [react](https://npm.io/package/react.md) 16.11.0
- [react-native](https://npm.io/package/react-native.md) 0.62.2

## Alternatives

- [@sindresorhus/slugify](https://npm.io/package/@sindresorhus/slugify.md) — 3.7M weekly downloads
- [solid-js](https://npm.io/package/solid-js.md) — 2.7M weekly downloads
- [expo-glass-effect](https://npm.io/package/expo-glass-effect.md) — 2.5M weekly downloads
- [nanoassert](https://npm.io/package/nanoassert.md) — 780.8K weekly downloads
- [@ffmpeg/ffmpeg](https://npm.io/package/@ffmpeg/ffmpeg.md) — 529.5K weekly downloads

## Recent versions

- 0.0.1 (latest) — 2020-08-07

## README

[![license](https://img.shields.io/github/license/mashape/apistatus.svg)]()

# React Native Stretchable Header

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

## Preview
[![rn-stretchable-header-2.gif](https://s7.gifyu.com/images/rn-stretchable-header-2.gif)](https://gifyu.com/image/c2dr)

## 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

| prop | type/valid values | default | description |
| - | - | - | - |
| headerImageHeight | number | 100 | Height of header image |
| headerImageSource | ImageSourcePropType | null | Stretchable header image [RN image source](https://facebook.github.io/react-native/docs/images.html) |
| contentView | ReactElement | 100 | Height 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](https://s7.gifyu.com/images/rn-stretchable-header.gif)](https://gifyu.com/image/c2dn)

You can copy and use  **TopNavigation** from [Example](https://github.com/iqbalansyor/react-native-stretchable-header/tree/master/Example/src). 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
* **Iqbal Ansyori** - [ansyori.iqbal@gmail.com](mailto:ansyori.iqbal@gmail.com)

## 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](https://opensource.org/licenses/MIT) for details.

---
_Source: https://npm.io/package/react-native-stretchable-header · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
