data |
required |
Items |
getImage(item, index, target) |
|
Image for the media area (no media area without it): require(...), { uri }, a list of { uri, width, height } variants, or a URL built from target (see Responsive images) |
renderItem({ item, index, offset }) |
|
Page content or a whole card. offset is this page’s distance from the current position (shared value) |
pageEffect |
'slide' |
How whole pages move: 'slide', 'parallax', 'stack', 'coverflow', 'cube', 'flip', 'fade', 'scale-fade', 'rotate', 'tinder', pageEffects.<name>(options) or a worklet (see Page layouts) |
pageSize |
page area |
Size of a page along the scroll axis; smaller shows the neighbors |
pageGap |
0 |
Space between pages |
pageAlign |
'center' |
'center' or 'start' |
snapMode |
'page' |
'page', 'momentum' or 'free' |
tapToNavigate |
false |
true or { mode, backZone, area } (mode 'sides' or 'forward', backZone 0.3, area 'all' or 'media'): tap to change page (see Tap to navigate) |
animation |
spring |
{ type: 'spring', damping, stiffness, mass } or { type: 'timing', duration } |
components |
|
Slots: Pagination, Dot, MediaOverlay, MediaBackground (see Slots) |
configureGesture(pan) |
|
Adjust the pan gesture (thresholds, simultaneous gestures) and return it. Memoize it |
keyExtractor(item, index) |
index |
Stable key for each item |
effect |
'liquid' |
'liquid', 'crossfade', 'slide', 'parallax', 'stack' or a worklet function (see below) |
liquid |
|
{ blur = 28, threshold = 0.5, sharpness = 24, preserveShape = false, decode = 'scheduled' }. Larger blur gives a rounder blob; lower threshold keeps more of the halo. preserveShape keeps the image rectangle sharp (no rounded corners) while only its content melts, for photos. decode picks when photos are decoded (see “How the liquid effect works”) |
mediaPosition |
'top' |
'top' or 'background' |
mediaHeight |
280 |
Height of the media area when it is at the top |
mediaFit |
'contain' |
'contain' or 'cover' |
mediaPadding |
16 |
Space around the image inside the media area |
getPlaceholderColor(item, index) |
|
Color that fills the image area, pulsing gently, while an image loads; the image fades in over it |
imageCache |
on |
Options for remote images (see Remote images and caching), or false |
direction |
'horizontal' |
'horizontal' or 'vertical' |
loop |
false |
Swipe past the last page to the first, and back |
initialIndex |
0 |
Page shown first |
autoplay |
false |
true or { interval = 4000, reverse = false, whenScreenReaderEnabled = false } |
windowSize |
2 |
Pages rendered and images kept loaded on each side of the current page |
prefetch |
1 |
Pages beyond the window on each side whose images are downloaded ahead, at low priority |
gestureEnabled |
true |
Allow swiping. ref navigation works either way |
pagination |
true |
false, or options: activeColor, inactiveColor, size, activeWidth, gap, pressable, style |
renderFooter(api) |
|
Content under the dots. Gets item, index, count, position, scrollTo, next, prev |
onIndexChange(index) |
|
Called when the nearest page changes, also during a drag |
onScrollStart() |
|
A swipe, a programmatic move or an autoplay step started |
onScrollEnd(index) |
|
The carousel came to rest on index |
positionValue |
|
A SharedValue<number> that mirrors the position in pages |
accessibilityLabel |
'Carousel' |
Screen reader label of the carousel |
getAccessibilityLabel(item, index) |
key |
Screen reader text for the current item |
ref |
|
{ scrollTo(index, { animated }), next({ count, animated }), prev({ count, animated }), getIndex() } |
style, mediaStyle, pageStyle, footerStyle, testID |
|
|