1.0.7 • Published 1 year ago

react-native-swipeable-carousel v1.0.7

Weekly downloads
-
License
MIT
Repository
github
Last release
1 year ago

React Native Swipeable Carousel

contributions welcome npm version npm downloads

A simple swipeable carousel created on the top of react-native-pager-view

Preview

demo gif

Get started

Pre-requisites

Since this package is created on the top of react native pager view and other libraries. So first you need to install them.

  yarn add react-native-size-matters react-native-pager-view react-native-svg

Installation

  yarn add react-native-swipeable-carousel

Usage

import Carousel from 'react-native-swipeable-carousel';

// imagePath can get images URL or imported images.

const data = [
    "https://cdn.pixabay.com/photo/2017/12/09/16/41/snow-man-3008179_1280.jpg",
      "https://cdn.pixabay.com/photo/2017/12/09/16/42/snow-man-3008179_1280.jpg"
];

<Carousel
  images={data}
  enableGestureSwipe={true}
/>

Properties

PropDescriptionDefaultRequired
imagesAn array of images (urls or local).NoneYes
heightCarousel height.200No
widthCarousel width.400No
enableGestureSwipeEnable gesture swipe(left/right).falseNo

Peer dependencies

  1. react-native-pager-view
  2. react-native-size-matters
  3. react-native-svg

License

This project is licenced under the MIT License.