Skip to content
Native Animation
Reflective Variant Carousel animation preview

This preview uses fictional demo content. See the props below for the customization options available in this component.

npx nativeanimation add variant-carousel
Carousel

Reflective Variant Carousel

React Native Product Carousel with Color Shift

A product carousel with perspective parallax and a cap-origin color sweep, with configurable variants, specifications, purchase bar color, and fonts.

$9 for this animation

Add to your project

Copy the component and its assets into your app with the Native Animation CLI, or paste the agent prompt into Claude Code, Codex or Cursor once the MCP server is connected.

About this animation

A React Native product carousel can make each variant feel like a distinct product moment while keeping selection in one continuous flow. This component loops through two or more product images and synchronizes the artwork, variant name, foreground copy, and full-screen color field. Use it for colorways, finishes, packaging, accessories, or another visually led option picker. Gesture Handler writes horizontal drag progress directly to one Reanimated shared value, and every item derives its wrapped position from that value, avoiding duplicated data. Interruptible springs settle the selection and power the same imperative navigation path. Customize product geometry, purchase copy, specifications, colors, fonts, thresholds, and spring behavior, then respond to settled changes with onIndexChange.

When to use it

  • Explore product colors or finishes.
  • Synchronize imagery, copy, and page color.
  • Loop through variants without duplicating data.
  • Drive selection from gestures or external controls.

A product carousel with perspective parallax and a cap-origin color sweep, with configurable variants, specifications, purchase bar color, and fonts.

How it works

  1. One continuous Reanimated shared value drives the selected variant, background, product layers, circular sweep, and liquid rail.
  2. Wrapped distance keeps the carousel infinite while each product derives its opacity, depth, horizontal parallax, and rotateY perspective.
  3. A large accent field scales from the product cap during a transition, then reveals the destination background as the spring settles.
  4. The active rail capsule stretches between variants; tapping any capsule uses the same interruptible spring as dragging and the imperative API.
  5. A mirrored product layer, clipped fade, contact shadow, translucent borders, and two-layer shadows create the polished studio-floor material.

Why this one

Most color carousels stop at a centered product, title, and dots. This pattern turns selection into a compact product story: the next item arrives from depth, the environment changes from the product itself, and the rail visibly carries momentum. Capacity selection and a real purchase action make the demo useful beyond the transition.

Install

npx expo install expo-linear-gradient react-native-gesture-handler react-native-reanimated react-native-worklets

Mount the app under GestureHandlerRootView as described by React Native Gesture Handler.

Usage

import { VariantCarousel } from './VariantCarousel';

const variants = [
  {
    name: 'Sage',
    image: require('./bottle-sage.png'),
    backgroundColor: '#DDE5DB',
    accentColor: '#81977D',
    brandColor: '#81977D',
    textColor: '#172019',
    secondaryColor: 'rgba(23,32,25,0.58)',
  },
  {
    name: 'Clay',
    image: require('./bottle-clay.png'),
    backgroundColor: '#EEE0D8',
    accentColor: '#BF8068',
    brandColor: '#BF8068',
    textColor: '#261B17',
    secondaryColor: 'rgba(38,27,23,0.58)',
  },
];

export function ProductScreen() {
  return <VariantCarousel variants={variants} />;
}

Customize the product content and motion without changing the component:

<VariantCarousel
  actionLabel="Reserve"
  brandName="North"
  capacities={['20 oz', '28 oz']}
  onActionPress={openCheckout}
  onIndexChange={setSelectedVariant}
  priceLabel="$42"
  productName="Trail Flask"
  springDamping={26}
  springStiffness={300}
  titleFontFamily="InstrumentSerif_400Regular"
  variants={variants}
/>

Props

NameTypeDefaultDescription
variantsVariantCarouselVariant[]RequiredTwo or more product images and coordinated color sets.
brandNamestring"NOVA"Small brand wordmark at the top.
productNamestring"Everyday Bottle"Large editorial product name.
specificationsVariantCarouselSpecification[]Generic bottle factsProduct values shown in the supporting line.
capacitiesstring[]["18 oz", "24 oz", "32 oz"]Capacity segment labels.
initialCapacityIndexnumber1Initially selected capacity.
actionLabelstring"Add to bag"Purchase action text.
priceLabelstring"$38"Formatted price text.
carouselAccessibilityLabelstring"Product color carousel"Screen-reader name for the adjustable carousel.
nextAccessibilityLabelstring"Next color"Screen-reader name for the tap-to-advance area.
nextAccessibilityHintstring"Shows the next color variant"Screen-reader hint for advancing.
onIndexChange(index: number) => void—Runs after a variant transition settles.
onGestureStart() => void—Runs when dragging or selecting a color begins.
onCapacityChange(index: number) => void—Runs when a capacity is selected.
onActionPress() => void—Runs when the purchase action is pressed.
springDampingnumber26Transition spring damping. Values below the damping needed for ζ ≥ 0.8 are raised to that minimum.
springStiffnessnumber260Transition spring stiffness.
springMassnumber1Transition spring mass.
swipeDistanceThresholdnumber0.16Required drag distance as a width fraction.
swipeVelocityThresholdnumber500Required horizontal fling velocity.
productSizeRationumber0.94Product size as a width fraction.
productHorizontalOffsetnumber0Product horizontal offset as a width fraction.
productVerticalOffsetnumber0.075Product top offset as a height fraction.
purchaseBarColorstring"#151713"Purchase-button background color.
purchaseTextColorstring"#FFFFFF"Purchase-button foreground color.
brandFontFamilystringSystemBrand and seal font family.
variantFontFamilystringSystemVariant-name font family.
bodyFontFamilystringSystemSupporting copy and control font family.
emphasisFontFamilystringSystemSelected values and CTA font family.
titleFontFamilystringSystemLarge product-name font family.
styleStyleProp<ViewStyle>—Outer container style.
testIDstring—Outer container test identifier.

The forwarded ref exposes goTo(index), next(), and prev().

Compatibility

  • Expo SDK 58, React Native 0.88, Reanimated 4.7, and Worklets 0.13.
  • Web: supported.
  • iOS and Android: supported.
  • Works in Expo Go because the native dependencies are included in the SDK 58 client.

Accessibility

The carousel exposes adjustable increment and decrement actions, every color and capacity is available by touch, and the CTA has a combined action-and-price label. Reduced Motion replaces perspective, parallax, and the circular sweep with a short crossfade while preserving every state change.

FAQ

Does this React Native product carousel work in Expo Go?
Yes. Gesture Handler, Reanimated, and Worklets are included in Expo SDK 58 and Expo SDK 57. Each published piece is reviewed on physical iPhone and Android devices with Expo Go before release.
What can I customize for each product variant?
Each variant supplies an image, name, and color set. The component also exposes product sizing, offsets, purchase labels, specifications, fonts, thresholds, and spring settings.
Is there an alternative to the swipe gesture?
Yes. A labeled next-variant button and the goTo, next, and prev ref methods use the same transition path. Reduce Motion removes spatial travel while content and colors still update.