1.0.0 • Published 3 years ago

awesome-carousel-component v1.0.0

Weekly downloads
2
License
MIT
Repository
-
Last release
3 years ago

awesome carousel component

Component accepts an array of either react elements or an array of react components from as prop children.

Installation

npm

npm install awesome-carousel-component

Example

Example code

import React from 'react';
import Slider from 'awesome-carousel-component';

const SimpleSlider = () => {
  return ({
    <Slider>
      {[
        <div key="1">
          <img />
        </div>,
        <div key="2">
          <img />
        </div>,
        <div key="3">
          <img />
        </div>
      ]}
    </Slider>
  });
};

Props

PropDescriptionDefaultType
childrenarray of either react elements or an array of react components!!
centerSlidethe index of the slide in the array, which is set to the center of the slider0number
visualSlidesCountnumber of displayed slides per page3number
slideMarginmargin to the right and left of each slide10number (in px)
durationduration of slide transition animation400number (in ms)
sliderHeightheight for sliderautostring (in px)
visualPartWidthwidth of the slider display window100%string (in %, in px, etc.)
slideWidthwidth of one slideautonumber (in px)
inMinStepsthe jump to the desired slide can follow the closest path from the current location through the beginning or end of the array to get fewer steps to the desired slidefalseboolean
isFlippingdo I need buttons to scroll to the right and left on the pagetrueboolean
isFlicktyDotsdo I need flickity page dots on the pagetrueboolean

Prop children is required, others may not be. Props can be changed at any time except for prop children.