Socket
Book a DemoInstallSign in
Socket

react-native-sticky-header-footer-scroll-view

Package Overview
Dependencies
Maintainers
1
Versions
11
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

react-native-sticky-header-footer-scroll-view

Sticky header and footer to any component and make it scrollable.

latest
Source
npmnpm
Version
2.1.3
Version published
Maintainers
1
Created
Source

A <StickyHeaderFooterScrollView> wrapper that

  • Takes a scrollview or listview
  • Or any component and make it scrollable
  • Takes a header and/or a footer and make them sticky
  • Works on iOS and Android

Add it to your project

iOS and Android

yarn add react-native-sticky-header-footer-scroll-view

or

npm install react-native-sticky-header-footer-scroll-view --save

Then:

  • Whenever you want to use it within React code you can:

import StickyHeaderFooterScrollView from 'react-native-sticky-header-footer-scroll-view';

Demo

Basic Usage

import StickyHeaderFooterScrollView from 'react-native-sticky-header-footer-scroll-view';

//Inside of a component's render() method:
render() {
  return (
    <StickyHeaderFooterScrollView
      renderStickyHeader={() => (
        <View style={...}>
          <Text>{`I'm a sticky header`}</Text>
        </View>
      )}
      renderStickyFooter={() => (
        <View style={...}>
          <Text>{`I'm a sticky footer`}</Text>
        </View>
      )}
    >
      <View style={{ height: 1200, backgroundColor: '#eee' }}>
        <Text>View made scrollable</Text>
      </View>
    </StickyHeaderFooterScrollView>
  )
}
PropDescriptionDefault
renderStickyHeaderA renderable function for the sticky header.null
renderStickyFooterA renderable function for the sticky footer.null
additionalHeightReserveA number of pixels to adjust for height taken out of screen by top or bottom navigation bars.0
makeScrollableSet true to make the component scrollable. (Do not set true if the input is a listview or flatlist)true
fitToScreenWhether to fill in space when children height is shorter than visible height.true
contentContainerStyleAny style prop to pass to the body.null
contentBackgroundColorBackground color of the main component.transparent

Example

cd example/StickyHeaderFooter

yarn

npm start

react-native run-ios or react-native run-android

Latest changes

2.1.0

  • Upgrades to React 16.0.0-beta.5 and RN 0.49.0

2.0.7

  • Fixes an issue to work with listview

2.0.4

  • Fixes an issue with footer spacer
  • Fixes a bug in the example

Keywords

react

FAQs

Package last updated on 22 Oct 2017

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts