Components

Carousel

Horizontal content carousel with pagination dots and arrow navigation.

iOSAndroid
Preview Carousel on your device

Scan with Expo Go

Download Expo Go, then scan the QR code to preview native components.

Installation

pnpm dlx @docyrus/cli add @docyrus/rn-carousel

Usage

import { Carousel } from '@/components/docyrus-native/carousel';

<Carousel
  data={[<Image source={img1} />, <Image source={img2} />, <Image source={img3} />]}
  showDots
  showArrows
/>

API Reference

PropTypeDefaultDescription
dataReactNode[]—Array of slide content (required)
autoPlaybooleanfalseEnable auto-play
autoPlayIntervalnumber3000Auto-play interval (ms)
showDotsbooleantrueShow pagination dots
showArrowsbooleanfalseShow navigation arrows
loopbooleanfalseEnable infinite loop
onIndexChange(index: number) => void—Slide change callback
classNamestring—Additional CSS classes
itemClassNamestring—Slide item CSS classes
dotClassNamestring—Inactive dot CSS classes
activeDotClassNamestring—Active dot CSS classes

Type Exports

TypeDescription
CarouselPropsProps for Carousel component

On this page