yarn react-native-reanimated-carousel 5.0.0-beta.1
v5.0.0-beta.1

7 hours ago

Minor Changes

  • #853 c595958 Thanks @dohooo! - - add itemWidth/itemHeight props so horizontal and vertical carousels can define their snapping step explicitly (e.g. to show multiple cards per page)

    • default behaviour still falls back to the carousel container size or legacy width/height props
  • #853 c595958 Thanks @dohooo! - ## ✨ Style API refresh

    • style now controls the outer carousel container (positioning, width/height, margins).
    • New contentContainerStyle replaces containerStyle for styling the scrollable content.
    • width and height props are deprecated; define size via style instead.

    Migration Example

    // Before
    <Carousel
      width={300}
      height={200}
      containerStyle={{ paddingHorizontal: 16 }}
    />
    
    // After
    <Carousel
      style={{ width: 300, height: 200 }}
      contentContainerStyle={{ paddingHorizontal: 16 }}
    />
    • Any layout logic still works; simply move width/height into style and container tweaks into contentContainerStyle.
    • contentContainerStyle runs on the JS thread—avoid adding opacity / transform there if you rely on built-in animations.

Patch Changes

  • #872 12c1a63 Thanks @dohooo! - Clamp visible ranges for non-loop overdrag and add test to ensure the first item stays visible when dragging right on the first page. Credits to PR #869 reporter.

  • #871 bc7daaf Thanks @dohooo! - Fix non-loop overscroll direction so tiny positive offsets at the first page no longer wrap to the last page when calling next()/scrollTo(), and add integration coverage for the scenario. Thanks to @hennessyevan for the original report and PR 839 inspiration.

  • #866 566bf52 Thanks @hennessyevan! - Fix pagination accessibility state by syncing selection with scheduleOnRN instead of reading reanimated values during render, and add coverage to avoid test warnings.

Don't miss a new react-native-reanimated-carousel release

NewReleases is sending notifications on new releases.