# Parallax Scroll — React Native component for Expo

> A photo header glides slower than the content, then a title bar fades in.

A scroll view with real depth: the header photo glides slower than the page, darkens as it leaves and stretches when you pull down, while a title bar fades in over it. Photos pan inside their frames and headlines drift at their own speed — all on the native driver, zero JS per scroll frame.

- Docs: https://expokit.in/docs/components/parallax-scroll
- Tier: Pro (ExpoKit Pro plan)
- Also called: parallax header, parallax scroll view, collapsing header
- Category: 3D
- Platforms: iOS, Android, web
- Expo Go: yes, no development build needed
- npm dependencies: react-native-svg
- Uses ExpoKit items: kit
- Variants: Place Details, Feed, Product Hero

## Installation

This component is part of ExpoKit Pro. With a Pro plan, log the CLI in once and add it like any other item:

```bash
npx @expokit/cli@latest login
```

Plans: https://expokit.in/pricing

## Props

| Prop | Type | Default | Description |
| --- | --- | --- | --- |
| `children` | `ReactNode` | — | The screen's content, under the header. |
| `header` | `ReactNode` | — | Fills the header area: a photo, a map, a gallery (wins over headerImage). |
| `headerImage` | `ImageSourcePropType` | — | Shortcut for a full-bleed header photo. |
| `headerAccessibilityLabel` | `string` | — | Describes headerImage for screen readers (skipped when omitted). |
| `headerHeight` | `number` | `300` | Header height, including the part under the status bar. |
| `headerSpeed` | `number` | `0.5` | How the header moves while scrolling up: 0 scrolls with the content, 1 stays pinned while the content slides over it. |
| `stretch` | `boolean` | `true` | iOS: pulling down stretches the header to fill the gap, anchored at the top. Turn off with a refreshControl. |
| `headerOverlay` | `ReactNode` | — | Pinned to the bottom of the header (a title over the photo); lifts and fades as it scrolls away, over a bottom scrim. |
| `title` | `string` | — | Ready-made top bar (theme background, hairline, centred title) that fades in once the header has scrolled under it. |
| `bar` | `ReactNode` | — | Your own bar instead: fills the bar area (topInset included) and fades in the same way. Decorative — buttons go in barLeft / barRight. |
| `barLeft / barRight` | `ReactNode` | — | Buttons pinned to the bar, visible over the photo too: each child sits on a round theme-coloured bubble that melts into the bar. Pass an array for several. |
| `barHeight` | `number` | `52` | Height of the bar row, below topInset. |
| `topInset` | `number` | `0` | Space above the bar for the status bar / notch — pass your safe-area top inset. |
| `contentContainerStyle` | `StyleProp<ViewStyle>` | — | Style for the content under the header (padding, gap, background — theme background by default). |
| `style` | `StyleProp<ViewStyle>` | — | Style for the outer frame (size, margins, radius). Fills its parent by default. |
| `className` | `string` | — | Tailwind classes on the root when using NativeWind or Uniwind. Prefer style for StyleSheet overrides. |
| `onScroll` | `(e) => void` | — | JS handler called alongside the native parallax event. For UI-thread effects use useParallaxScroll().scroll instead of your own Animated.event. |
| `ref` | `Ref<ScrollView>` | — | Forwarded to the scroll view, so you can call scrollTo. |
| `…ScrollView props` | `ScrollViewProps` | — | Everything else is passed to the scroll view (vertical only): refreshControl, onScrollEndDrag, nestedScrollEnabled… |
| `ParallaxImage.source` | `ImageSourcePropType` | — | The photo. |
| `ParallaxImage.height` | `number` | `200` | Frame height. |
| `ParallaxImage.speed` | `number` | `0.3` | How much slower than its frame the photo moves: 0 still, 1 fixed on screen, negative the other way. |
| `ParallaxImage.radius` | `number` | `radius.lg` | Corner radius of the frame. |
| `ParallaxImage.scrim` | `boolean` | `on with children` | Bottom gradient so white text reads on the photo. |
| `ParallaxImage.children` | `ReactNode` | — | Content over the photo, aligned to the bottom (a caption, a tag). |
| `ParallaxImage.accessibilityLabel` | `string` | — | Describes the photo for screen readers. |
| `ParallaxImage.style / imageStyle` | `StyleProp<ViewStyle> / StyleProp<ImageStyle>` | — | Style for the frame / for the photo itself. |
| `ParallaxView.speed` | `number` | `0.2` | Offset relative to the scroll: positive lags behind the content, negative leads it. |
| `ParallaxView.children / style` | `ReactNode / StyleProp<ViewStyle>` | — | What drifts, and its style (the transform is taken by the parallax). |
| `useParallaxScroll()` | `() => { scroll, viewport, contentHeight, contentRef } \| null` | — | The live scroll offset (native-driver friendly), viewport size and content size for your own effects; null outside a ParallaxScrollView. |

## Behaviour & accessibility

- **Motion**: The header lags behind the scroll and darkens as it leaves. The bar, title and button bubbles fade in once it has scrolled under the bar.
- **Touch**: On iOS, pulling down past the top stretches the header to fill the gap. Set stretch to false when you use a refreshControl.
- **Reduced motion**: With Reduce Motion on, the header, ParallaxImage and ParallaxView parallax offsets switch off; the stretch and the fades stay.
- **Screen readers**: The bar comes first in reading order and its title is a header. Header and ParallaxImage photos are labelled images only when you give them a label.
- **Platforms**: The scroll offset drives everything through a native Animated.event, so there is no JS work while scrolling.

## FAQ

### How do I make a parallax header in React Native?

Use ExpoKit's Parallax Scroll, a Pro component: with ExpoKit Pro, the ExpoKit CLI copies a ready-made parallax header into your Expo or React Native app as plain TypeScript you can edit. It works on iOS, Android and web, and in Expo Go.

### Does Parallax Scroll work in Expo Go?

Yes. Parallax Scroll runs in Expo Go on iOS and Android with no development build — its packages (react-native-svg) are all included in Expo Go.

### How do I add Parallax Scroll to my Expo app?

With ExpoKit Pro, add it with the ExpoKit CLI: it copies the component's source into your app and installs react-native-svg, so the code is yours to change. The install command is on this page for Pro members.

### Is Parallax Scroll free?

Parallax Scroll is part of ExpoKit Pro. With a Pro plan, log the CLI in once and it installs the full source into your app.

## More

- Live preview, variants and code: https://expokit.in/docs/components/parallax-scroll
- Every ExpoKit component, screen, template and chart: https://expokit.in/llms.txt
- Install commands and props for every free component: https://expokit.in/llms-full.txt
- Pricing: https://expokit.in/pricing
