Home

Awesome

React Native ScrollView Header

npm (scoped)

Animated ScrollView Header for React Native

<img src="https://github.com/weifxn/react-native-scrollview-header/blob/master/img/img.gif" width="300">

Installation

$ npm install react-native-scrollview-header

or

$ yarn add react-native-scrollview-header

Usage

import React from 'react'
import { View } from 'react-native'
import Header from 'react-native-scrollview-header';

class Component extends React.Component {
	render() {
		const data = [{ name: 'Pink Floyd', age: '30' }];

		return (
			<Header title="Names" barStyle={{ backgroundColor: 'grey' }}>
				{data.map(item => (
					<Text> {item.name} </Text>
				))}
			</Header>
		);
	}
}

Props

PropDefaultTypeDescription
titleundefinedstringTitle for header
titleStyleundefinedobjectStyles for header title
headerStyleundefinedobjectStyles for title container
barStyleundefinedobjectStyles for header bar
maxHeight130numberMaximum height of header (animated)
minHeight95numberMinimum height of header (animated)
extrasundefinedobjectExtra items above title (icon)