Kinetik UI

Parallax Carousel

.md

A paging carousel whose pictures drift inside their cards as they slide, with the centre card brought forward.

v1.0.0Live on webreact-native-gesture-handlerreact-native-reanimatedreact-native-worklets
Component preview

Installation

Kinetik CLI
npx kinetik-ui add parallax-carousel

The CLI copies the source and installs native dependencies with npx expo install, so versions match your Expo SDK. With shadcn: npx shadcn@latest add https://kinetik-ui.dev/r/parallax-carousel.json

Install manually

  1. Install dependencies
    npx expo install react-native-gesture-handler react-native-reanimated react-native-worklets
  2. Copy the source files
    • components/kinetik/parallax-carousel.tsx
    View source files

Usage

import { ParallaxCarousel } from '@/components/kinetik/parallax-carousel';

<ParallaxCarousel
  items={trips.map((t) => ({
    key: t.id,
    image: { uri: t.photo },
    title: t.name,
    subtitle: t.city,
  }))}
  onPress={(item) => router.push(`/trips/${item.key}`)}
/>;

The carousel fills its parent's width. Cards are cardWidth of it (78% by default) so the neighbours peek in from the sides, and aspect sets their height. Captions sit on a dark gradient at the bottom of each picture.

When to use

  • Browsing a handful of visual items: places, products, albums, artworks.
  • Feature or story cards on a home screen.

When not to use

  • Long lists that people search or compare. Use a grid or a list.
  • Content that has to be read in full; only the centre card has room to breathe.

Notes

  • parallax sets how far each picture drifts inside its card; the image is drawn wider than the card to make room.
  • A tick plays each time a new card comes to the centre.
  • Drag with a finger, a mouse or a pen; past either end the row resists like rubber, and a flick moves up to three cards.
  • Tap the centre card to press it; tap a side card to bring it to the centre.
  • Screen readers get Next card and Previous card actions on every card.

Props

ParallaxCarouselProps

PropTypeDefaultDescription
itemsrequiredreadonly CarouselItem[]—
cardWidthnumber0.78Card width as a share of the carousel's width, 0.5–0.95. Defaults to 0.78.
aspectnumber1.25Card height divided by width. Defaults to 1.25.
parallaxnumber0.6How far the image drifts inside its card, 0–1. Defaults to 0.6.
gapnumber14Space between cards. Defaults to 14.
showProgressbooleantrueThin progress line under the cards. Defaults to true.
onPress(item: CarouselItem, index: number) => void—Called when the centre card is tapped. A tap on a side card brings it to the centre.
onIndexChange(index: number) => void—Called when a new card reaches the centre.
hapticsbooleantrueA tick as each card reaches the centre. Defaults to true.
testIDstring—
styleStyleProp<ViewStyle>—

Performance and accessibility

Performance

Budget
One drag offset drives three transforms per card on the UI thread; React renders only when the centre card changes.
Measured

Pixel 9 emulator, API 35, release build · interaction median 0.85× the system Settings app on the same emulator (indicative only) · no frames drawn at rest · 160 MB app memory

Real-device measurement pending.

Accessibility

Reduced motion
Cards keep their size and the pictures stay put; cards settle without overshoot.
Screen readers
Each card is an image (or a button when onPress is set) named by its title or accessibilityLabel, with Next card and Previous card actions; the centre card is selected.
Touch target
Cards are at least half the carousel's width.

Source files

components/kinetik/parallax-carousel.tsx is in the Code tab of the preview above.