Skip to main content
Version: 1.x

HeaderMotion.ScrollManager

A render-prop component for managing custom scrollables. Prefer createHeaderMotionScrollable() for most integrations.

Use ScrollManager only when the factory approach doesn't give you enough flexibility.

Usage

<HeaderMotion.ScrollManager scrollId="custom">
{(scrollableProps, { originalHeaderHeight, contentContainerMinHeight }) => (
<Animated.ScrollView {...scrollableProps}>
<Animated.View style={{ paddingTop: originalHeaderHeight }}>
{/* content */}
</Animated.View>
</Animated.ScrollView>
)}
</HeaderMotion.ScrollManager>

Props

PropTypeDefaultDescription
scrollIdstringUnique identifier for multi-scroll setups.
children(scrollableProps, headerMotionContext) => ReactNodeRender function receiving managed props and layout context.
refreshControlReactElementRefresh control element.
refreshingbooleanWhether refresh is active.
onRefresh() => voidRefresh callback.
progressViewOffsetnumberCustom offset for the refresh indicator.
animatedRefAnimatedRefExternal animated ref.

Render function arguments

scrollableProps contains:

  • onScroll — managed scroll handler
  • onLayout — layout handler for min-height calculations
  • refreshControl — resolved refresh control (if applicable)
  • ref — animated ref for the scrollable

headerMotionContext contains:

  • originalHeaderHeight: number — measured header height for content offsetting
  • contentContainerMinHeight?: number — computed min height (when ensureScrollableContentMinHeight is used)