DrumGallery
A large photo with an endless thumbnail strip that bends around a 3D drum. Tap a thumbnail to centre it and show it large.
Preview
Installation
npx @codewithrabby/ui@latest add drum-galleryUsage
import { DrumGallery } from "@/components/uir/drum-gallery";
<View style={{ flex: 1 }}>
<DrumGallery
images={photos}
stepDeg={30}
onChange={(index) => console.log(index)}
/>
</View>Props
| Prop | Type | Default |
|---|---|---|
imagesPhotos to show. The strip loops them endlessly. | ImageSource[] | — |
thumbSizeThumbnail size. | number | 75 |
gapSpace between thumbnails. | number | 14 |
stepDegAngle between neighbours on the drum. Higher = tighter curve. | number | 30 |
depthCamera distance. Lower = stronger 3D. | number | 500 |
curveWhich way the thumbnails face. | 1 | -1 | 1 |
showPreviewShow the large photo above the strip. | boolean | true |
onChangeCalled with the tapped image's index. | (index: number) => void | — |