# Cube Pager — React Native component for Expo

> Swipeable pages that turn like the faces of a cube, with flick momentum.

Swipeable pages that turn like the faces of a cube — from the outside, the inside, or spinning in place. Follows your finger, carries flick momentum, rubber-bands at the ends and shades faces as they turn away. Great for stories and onboarding.

- Docs: https://expokit.in/docs/components/cube-pager
- Tier: Pro (ExpoKit Pro plan)
- Also called: 3D cube pager, cube transition, story pager
- Category: 3D
- Platforms: iOS, Android, web
- Expo Go: yes, no development build needed
- Uses ExpoKit items: kit
- Variants: Stories, Onboarding, Plans

## 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 |
| --- | --- | --- | --- |
| `children` | `ReactNode` | — | One child per page. |
| `height` | `number` | `260` | Page height. |
| `effect` | `"cube" \| "inside" \| "flip"` | `"cube"` | Outside of a cube, its inner walls, or each page spinning in place. |
| `index` | `number` | — | Controlled page. |
| `defaultIndex` | `number` | `0` | Uncontrolled initial page. |
| `onIndexChange` | `(index: number) => void` | — | Fires when the page changes. |
| `pagination` | `boolean` | `true` | Dots under the pager. |
| `shade` | `boolean` | `true` | Darken faces as they turn away. |
| `accent` | `string` | `theme foreground` | Active dot colour. |
| `radius` | `number` | `20` | Corner radius of the pages. |
| `disabled` | `boolean` | `false` | Turn swiping off (dots and a controlled index still work). |
| `style` | `StyleProp<ViewStyle>` | — | Style for the root view. |
| `className` | `string` | — | Tailwind classes on the root when using NativeWind or Uniwind. Prefer style for StyleSheet overrides. |

## Behaviour & accessibility

- **Touch**: Pages follow your finger. A quick flick or a drag past 35% turns the page, and the first and last pages rubber-band.
- **Motion**: Pages rotate around their shared edge in 3D (cube, inside or flip) and darken as they turn away when shade is on.
- **Screen readers**: The pager is adjustable with a "2 / 5" value and increment and decrement actions. Off-screen pages are hidden and dots are buttons.

## FAQ

### How do I make a 3D cube pager in React Native?

Use ExpoKit's Cube Pager, a Pro component: with ExpoKit Pro, the ExpoKit CLI copies a ready-made 3D cube pager 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 Cube Pager work in Expo Go?

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

### How do I add Cube Pager 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 Cube Pager free?

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

## More

- Live preview, variants and code: https://expokit.in/docs/components/cube-pager
- 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
