Scroll
How far the carousel should move when its goForward() and goBack() methods are called.
Details
Prop Name | Type | Default Value |
---|---|---|
scrollDistance | "slide" | number | "screen" | slide |
slide
- Using "slide" will advance the carousel one slide each time.number
- Using a number will cause the carousel to scroll that many pixels each time.screen
- Using "screen" will advance the carousel by the width of the visible carousel.
Example
- Slide
- Fixed Distance (number)
- Screen
Default scroll by slide width. The scroll distance will automatically update on the widths of the slides so you can have multiple widths for each slide.
Code
<Carousel scrollDistance="slide" showForwardBackButtons={true}>
<img src="pexels-01.jpg" />
<img src="pexels-02.jpg" />
<img src="pexels-03.jpg" />
</Carousel>