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-carouselUsage
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
| Prop | Type | Default |
|---|---|---|
collections{ id, title, cover, color, items: { image, label? }[] }. First 3 items float, first 6 show in the grid. | Collection[] | — |
cardRatioFolder width as a fraction of the carousel width. | number | 0.6 |
openOnPressOpen the item grid when a folder is tapped. | boolean | true |
onPressCollectionCalled when a folder is tapped. | (c: Collection) => void | — |
backgroundColorShown behind the cover photos. | string | "#000" |
styleStyle for the outer container. | ViewStyle | — |