You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
-`runAutoScroll`: Function to manually trigger auto-scroll with custom interval
224
224
-`goToPage`: Function to programmatically navigate to a specific slide from another slide
225
225
226
-
###Utilities
226
+
#### `useInterpolateInsideCarousel()`
227
227
228
-
#### `interpolateInsideCarousel()`
229
-
230
-
Advanced interpolation utility for creating custom slide animations.
228
+
Hook for creating custom slide animations with automatic interpolation based on carousel scroll position. Must be used within a slide component (inside `HeroCarousel`). Returns a `SharedValue` that you can use in animated styles.
return <Animated.Viewstyle={animatedStyle}>{/* Your content */}</Animated.View>
254
+
}
248
255
```
249
256
257
+
**Returns:**
258
+
259
+
A `SharedValue` (from `useDerivedValue`) representing the interpolated progress value (0-1) based on the current slide's position in the carousel. Access the value using `.value` in animated styles or worklet functions.
|`valueBefore`|`number`| Required | Value to use for slides before the current slide |
266
+
|`thisValue`|`number`| Required | Value to use for the current slide |
267
+
|`valueAfter`|`number`| Required | Value to use for slides after the current slide |
268
+
|`offset`|`number`|`0`| Animation offset (0-1) to control when the animation starts/ends |
269
+
270
+
**Note:** The `interpolateInsideCarousel` utility function is now internal-only. Use this hook instead for all custom animations. The hook automatically handles the slide context (index, total, scrollValue) internally.
271
+
250
272
## Examples
251
273
252
274
We provide a comprehensive example app showcasing all the carousel features. You can run the examples locally or view the source code:
@@ -276,7 +298,7 @@ Then scan the QR code with Expo Go or run on simulator. See the [example app REA
276
298
277
299
-**Image Carousels** with smooth transitions and auto-scrolling
278
300
-**Video Integration** with `expo-video` and playback controls
279
-
-**Custom Animations** using `interpolateInsideCarousel` utility
301
+
-**Custom Animations** using `useInterpolateInsideCarousel` hook
280
302
-**Entering/Exiting Animations** using `HeroCarousel.AnimatedView` component
281
303
-**Timer-based Pagination** with visual progress bars
282
304
-**Gesture Handling** with swipe navigation and user interaction detection
0 commit comments