LogoCraftReactNative
Components

PhotoCarousel

A photo carousel component that displays a list of photos in a carousel that can be swiped.

Installation

npx @craftreactnative/ui add PhotoCarousel

Usage

Screen.tsx
import { PhotoCarousel } from '@/craftrn-ui/components/PhotoCarousel';
 
export const Screen = () => (
  <PhotoCarousel
    photos={[
      { id: '1', uri: 'https://picsum.photos/200/300' },
      { id: '2', uri: 'https://picsum.photos/200/300' },
      { id: '3', uri: 'https://picsum.photos/200/300' },
    ]}
    carouselHeight={200}
  />
);

Props

PropTypeDefault
photos
Photo[]
-
carouselHeight?
number
200
dotsStyle?
any
-

Dependencies

2 packages
react-native-reanimated
react-native-unistyles

On this page