# Carousel — React Native component for Expo

> A snapping carousel whose neighbouring slides shrink, fade or tilt with the scroll.

Snapping horizontal carousel where neighbouring slides shrink, fade or tilt in 3D with the scroll position (native driver). Dots, expanding dots or a progress bar, autoplay that pauses while you touch, and a per-slide progress value for your own parallax.

- Docs: https://expokit.in/docs/components/carousel
- Tier: Pro (ExpoKit Pro plan)
- Also called: image carousel, slider, swiper, image gallery
- Category: Display
- Platforms: iOS, Android, web
- Expo Go: yes, no development build needed
- Uses ExpoKit items: kit
- Variants: Scale, Expanding Dots, Controlled, Coverflow, Parallax, Cards

## Installation

This component is part of ExpoKit Pro. With a Pro plan, log the CLI in once and add it like any other item:

```bash
npx @expokit/cli@latest login
```

Plans: https://expokit.in/pricing

## Props

| Prop | Type | Default | Description |
| --- | --- | --- | --- |
| `data` | `T[]` | — | Items to render, one slide each. |
| `renderItem` | `({ item, index, progress, width }) => ReactNode` | — | Render a slide. `progress` runs -1 → 0 → 1 across the centre — use it for parallax. |
| `keyExtractor` | `(item: T, index: number) => string` | `index` | React key for each slide. |
| `itemWidth` | `number` | `0.82` | Fraction of the carousel (≤ 1) or points. Capped at 460pt for tablets. |
| `height` | `number` | `200` | Slide height. |
| `gap` | `number` | `12` | Space between slides. |
| `effect` | `"scale" \| "coverflow" \| "flat"` | `"scale"` | How neighbours look. |
| `pagination` | `"dots" \| "expanding" \| "bar" \| "none"` | `"dots"` | Indicator under the slides; dots are tappable. |
| `autoplay` | `boolean \| number` | `false` | Advance every 3.5s (or N ms); pauses while touched. |
| `loop` | `boolean` | `true` | Autoplay wraps to the first slide. |
| `index` | `number` | — | Controlled active slide. Pair with onIndexChange so autoplay / swipes update parent state. |
| `defaultIndex` | `number` | `0` | Uncontrolled initial slide (ignored when index is set). |
| `onIndexChange` | `(index: number) => void` | — | Fires when the centred slide changes (swipe, dots, autoplay). |
| `accent` | `string` | `theme accent` | Active dot / bar colour. |
| `style` | `StyleProp<ViewStyle>` | — | Style for the root view wrapping the slides and pagination. |
| `className` | `string` | — | Tailwind classes on the root when using NativeWind or Uniwind. Prefer style for StyleSheet overrides. |

## Behaviour & accessibility

- **Touch**: Swipe to snap from slide to slide. Autoplay waits while you drag and resumes after.
- **Motion**: Slide effects are interpolated from the scroll position on the native driver. renderItem also gets a progress value for your own parallax.
- **Screen readers**: The scroller is adjustable, reads "Slide 2 of 5" and supports increment and decrement. Dots are buttons labelled "Go to slide N".
- **Web**: Settles on the nearest slide once scrolling stops, since the web has no snap momentum.

## FAQ

### How do I make an image carousel in React Native?

Use ExpoKit's Carousel, a Pro component: with ExpoKit Pro, the ExpoKit CLI copies a ready-made image carousel into your Expo or React Native app as plain TypeScript you can edit. It works on iOS, Android and web, and in Expo Go.

### Does Carousel work in Expo Go?

Yes. Carousel runs in Expo Go on iOS and Android with no development build.

### How do I add Carousel to my Expo app?

With ExpoKit Pro, add it with the ExpoKit CLI: it copies the component's source into your app, so the code is yours to change. The install command is on this page for Pro members.

### Is Carousel free?

Carousel is part of ExpoKit Pro. With a Pro plan, log the CLI in once and it installs the full source into your app.

### Can I change how Carousel looks?

Yes. It takes its colours, radius and light / dark mode from useKit(), so wrapping your app in <KitProvider accent radius> re-skins it with every other ExpoKit component. The code lives in your project, so you can also edit anything directly.

## More

- Live preview, variants and code: https://expokit.in/docs/components/carousel
- Every ExpoKit component, screen, template and chart: https://expokit.in/llms.txt
- Install commands and props for every free component: https://expokit.in/llms-full.txt
- Pricing: https://expokit.in/pricing
