Skip to main content
Version: 1.x

HeaderMotion.Header

The main header container. It measures the total header height and can optionally make the header surface pannable.

By default, the header is absolutely positioned above content (overlay: true).

Usage

<HeaderMotion.Header style={[styles.header, animatedStyle]}>
<HeaderMotion.Header.Dynamic>
{/* collapsible section */}
</HeaderMotion.Header.Dynamic>
<View>{/* sticky section */}</View>
</HeaderMotion.Header>

Props

Accepts all Animated.View props, plus:

PropTypeDefaultDescription
overlaybooleantrueAbsolutely positions the header above content. Disable only if you want the header in normal layout flow.
pannablebooleanfalseAllows dragging on the header surface to drive the scroll interaction.
panDecayConfigWithDecayConfig | (event: HeaderPanDecayEvent) => WithDecayConfigCustomizes momentum animation after a header pan ends.
withGestureHandlerRootViewbooleanfalseWraps the gesture subtree in GestureHandlerRootView when needed.
asChildbooleanfalseInjects the total-height measurement into a single child instead of rendering the default Animated.View.