UIR

CollectionCarousel

Horizontal carousel of glass folders with items floating out of the top. The cover photo cross-fades as you scroll; tap a folder to open a grid of its items.

Preview

Preview coming soon

Try it live: run the CLI command below in an Expo app, or open the Code tab.

Installation

npx @codewithrabby/ui@latest add collection-carousel

Usage

import { CollectionCarousel, type Collection } from "@/components/uir/collection-carousel";

const collections: Collection[] = [
  {
    id: "blue",
    title: "The Blue Edit",
    cover: require("./blue-cover.jpg"),
    color: "rgba(161,185,197,0.7)",
    items: [{ image: require("./shoe.jpg"), label: "₦85,000" }],
  },
];

<View style={{ flex: 1 }}>
  <CollectionCarousel collections={collections} />
</View>

Props

PropTypeDefault
collections

{ id, title, cover, color, items: { image, label? }[] }. First 3 items float, first 6 show in the grid.

Collection[]—
cardRatio

Folder width as a fraction of the carousel width.

number0.6
openOnPress

Open the item grid when a folder is tapped.

booleantrue
onPressCollection

Called when a folder is tapped.

(c: Collection) => void—
backgroundColor

Shown behind the cover photos.

string"#000"
style

Style for the outer container.

ViewStyle—