foontofoonto

Component

Carousel

A center-focused, snapping carousel (Hotstar / App Store style).

How to use

Minimal, copy-pasteable code.

Featured.tsx
import { Carousel } from "react-native-foonto";
import { Image } from "react-native";

const DATA = [
  { id: "1", uri: "https://picsum.photos/id/10/600/800" },
  { id: "2", uri: "https://picsum.photos/id/20/600/800" },
  { id: "3", uri: "https://picsum.photos/id/30/600/800" },
];

export function Featured() {
  return (
    <Carousel
      data={DATA}
      itemHeight={360}
      onIndexChange={(i) => console.log("centered", i)}
      renderItem={(item) => (
        <Image source={{ uri: item.uri }} style={{ flex: 1, borderRadius: 24 }} />
      )}
    />
  );
}

Props

PropTypeDefaultDescription
datareqT[]Items to render.
renderItemreq(item: T, index: number) => ReactNodeRender one card's content.
itemWidthnumber70% screenCard width in px.
itemHeightnumber360Card height in px.
spacingnumber16Gap between cards in px.
sideScalenumber0.86Scale of the side (non-focused) cards.
sideOpacitynumber0.6Opacity of the side cards.
onIndexChange(index: number) => voidFired with the centered card index after a snap.
styleFoontoStyleStyle for the scroll view.

AI prompt

Install the library, then paste this into your AI coding agent to wire it up.

AI prompt
Add a center-focused snapping carousel using the `react-native-foonto` library.

1. Make sure `react-native-foonto` and `react-native-reanimated` are installed.
2. Import `Carousel` from `react-native-foonto`.
3. Pass a `data` array and a `renderItem` returning a full-bleed card (image/poster).
4. Set `itemHeight` (and optionally `itemWidth`); tune `sideScale` / `sideOpacity` for the focus effect.
5. Use `onIndexChange` to track the centered item (e.g. for a caption or dots).