npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

@johankladder/react-native-collapsible-header-components

v0.2.2

Published

A React Native package that contains the sources for Collapsible Header Components

Readme

react-native-collapsible-header-components

https://www.npmjs.com/package/@johankladder/react-native-collapsible-header-components

This package contains a <CollapsibleScrollView/> and a <CollapsibleFlatList/> component. These components can be used as a 'normal' ScrollView/FlatList, but can have collapsible headers.

What are 'collapsible headers' ?

Collapsible headers are bars that are in top of scroll-views. Most of the time these bars contain controllers, like: a channel selector or a search-bar. The point is, they make up space on the top space of a view and should collapse when the user scrolls down.

When do I need 'collapsible headers' ?

Collapsible headers can be used when your header takes up a lot of space in the UI. With a collapsible header it is possible to automatically remove the header when scrolling down and show it again when scrolling up.

Additional properties of the 'scroll-views'.

Both the <CollapsibleScrollView/> and the <CollapsibleFlatList/> contain the following additional props (next to the default props of the given component):

Property | Default | Description ---------|---------|------------ collapsibleHeaderHeight | Required | The height of the header. (integer) collapsibleHeader | Required | The actual header component (React.Component) statusBarHeight | 0 | The height that the logic should always remain. So when given 100, the lower 100 pixels is always visible. (integer)

Example code:

    import {CollapisbleScrollView} from '@johankladder/react-native-collapsible-header-components'

    [...]
    
    renderCollapsibleScrollView = () => {
        return (
            <CollapsibleScrollView
                ref={ref => this.collapsibleScrollView = ref}
                collapsibleHeader={this.renderHeaderWithMarkers()}
                collapsibleHeaderHeight={225}
                statusBarHeight={75}
            >
                {this.renderItemsForScrollView()}
            </CollapsibleScrollView>
        )
    };

    renderHeaderWithMarkers = () => {
        return (
            <View style={{}}>
                <View style={{height: 75, backgroundColor: 'red'}}/>
                <View style={{height: 75, backgroundColor: 'green'}}/>
                <View style={{height: 75, backgroundColor: 'blue'}}/>
            </View>
        )
    };
    
    renderItemsForScrollView = () => {
        let items = [];
        for (let i = 0; i < 50; i++) {
            items.push(
                <View key={'test-' + i}
                      style={{flex: 1, height: 50, backgroundColor: 'yellow', borderWidth: 1, borderColor: 'black'}}>
                    <Text>{i}</Text>
                </View>
            )
        }
        return items;
    }; 
    
    [...]

To access to reference of the actual inner ScrollView (for performing scroll actions on the component), you can reference it in the above shown way. But you need to access the inner ref by calling:

this.collapsableScrollView.reference.getNode().scrollToEnd() where scrollToEnd() can be any supported function you would like to use.

How It looks:

Installation:

  • npm i @johankladder/react-native-collapsible-header-components
  • yarn add @johankladder/react-native-collapsible-header-components

Known bugs:

  • Currently the RefreshControl of iOS is not visible. This is because a offset can not be set. On iOS make sure you set the progressViewOffset property according to you need. Most of the time I set it to the height of the header.

Contribution:

Feel free to contribute and open pull-requests!