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 🙏

© 2025 – Pkg Stats / Ryan Hefner

@ekosh02/react-native-animated-header-scroll-view

v1.2.3

Published

Lightweight React Native ScrollView with animated header. No reanimated or gesture-handler required.

Readme

@ekosh02/react-native-animated-header-scroll-view

This is a custom React Native component that makes it easy to create animated scroll views with dynamic headers. It provides smooth and responsive animations based on scroll position and extends the standard ScrollView without reanimated reliance.

   

Installation

Install using npm:

npm install @ekosh02/react-native-animated-header-scroll-view

Or using yarn:

yarn add @ekosh02/react-native-animated-header-scroll-view

Peer dependency:

This library uses react-native-safe-area-context for handling safe area insets. Make sure it's installed in your project:

Install using npm:

npm install react-native-safe-area-context

Or using yarn:

yarn add react-native-safe-area-context

   

Features

  • Simplifies the creation of animated headers in React Native applications.
  • Smooth scaling and translation animations based on scroll position.
  • Automatically handles header transitions with fade-in and fade-out effects.
  • No react-native-reanimated.

   

Usage Example

Here's an example of how to use @ekosh02/react-native-animated-header-scroll-view in a React Native project:

import { AnimatedScrollView } from '@ekosh02/react-native-animated-header-scroll-view'
import { Text, View } from 'react-native'

const ExampleScreen = () => {
  return (
    <AnimatedScrollView
      topHeaderComponent={
        <View>
          <Text>Top Header</Text>
        </View>
      }
      scrolledHeaderComponent={
        <View>
          <Text>Scrolled Header</Text>
        </View>
      }
      contentComponent={
        <View>
          <Text>Animated Content</Text>
        </View>
      }
      useSafeArea={true}
    >
      <View>
        <Text>Static child content goes here</Text>
      </View>
    </AnimatedScrollView>
  )
}

export default ExampleScreen

   

Component Props

The AnimatedScrollView component accepts the following props:

| Prop | Type | Description | | ------------------------- | ------------------------------ | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | | topHeaderComponent | React.ReactNode \| undefined | Component displayed as the main header before scrolling. | | scrolledHeaderComponent | React.ReactNode \| undefined | Component displayed as the header after scrolling past a threshold. | | contentComponent | React.ReactNode \| undefined | Content inside the scroll view that will be animated with scaling and translation effects. | | children | React.ReactNode \| undefined | Regular static content inside the scroll view. | | scaleMin | number \| undefined | Controls how much the ContentView shrinks during the scroll animation. For example, scaleMin={0.8} means the ContentView shrinks to 80% of its original size while scrolling. | | headerBackgroundColor | ColorValue \| undefined | Background color for the scrolledHeaderComponent. Useful for matching the background when the header becomes sticky. Example: "#ffffff". | | useSafeArea | boolean \| undefined | Enables or disables usage of safe area insets (e.g., for iPhone notch). If true, padding will be added to the top using useSafeAreaInsets(). Defaults to false. | | ...props | ScrollViewProps \| undefined | Any additional props passed to the underlying ScrollView. |

   

Component Behavior

The AnimatedScrollView component automatically provides smooth transitions and animations for the header and content:

| Behavior | Description | | ----------------- | -------------------------------------------------------------------------------------------------------------------- | | Header Transition | Smooth fade transitions between topHeaderComponent and scrolledHeaderComponent, triggered by scroll position. | | Content Scaling | The contentComponent element scales down and translates upwards when the user scrolls, creating a parallax effect. | | Scroll Tracking | Scroll position is dynamically tracked, triggering appropriate animations and header changes. |

   

Image Scaling Issue

Using scaleMin = 0.7 in ContentView may cause empty spaces around the image due to reduced width.

To fix сalculate the initial image width from screen width and scale to avoid gaps:

  1. Get the screen width using Dimensions.get("window").width.
  2. Calculate INITIAL_WIDTH by dividing the screen width by SCALE_AT_MIN.
  3. Apply INITIAL_WIDTH to your image or content in ContentView to ensure it scales correctly.
import { Dimensions } from 'react-native'

const screenWidth = Dimensions.get('window').width
const SCALE_AT_MIN = 0.7
const INITIAL_WIDTH = screenWidth / SCALE_AT_MIN

   

Contribution Guidelines

We welcome contributions! Here’s how you can help:

  • Report issues or request features by opening an issue.
  • Submit pull requests to suggest fixes or enhancements.

Before contributing, please ensure your code follows the project's style and passes all tests.

   

License

This project is licensed under the ISC License.