0.3.1 • Published 10 months ago

react-image-slider-3d v0.3.1

Weekly downloads
-
License
MIT
Repository
github
Last release
10 months ago

3D Image Slider React Wrapper

This 3D Image slider was inspired by the video created by Lun Dev Code

This library is a react wrapper that allows the use of the slider in React and Next.js projects. There are number of options you can try changing to change the view and animation options.

View a Next.js Demo here

Installation

Install using npm

npm install react-image-slider-3d

Usage

  • Import the library
    import { ImageSlider } from "react-image-slider-3d";
  • The following code is a usage example of library
        <ImageSlider
          images={[
            {src: 'https://picsum.photos/200/300?random=1&blur=2'},
            {src: 'https://picsum.photos/200/300?random=2'},
            {src: 'https://picsum.photos/200/300?random=3'},
            {src: 'https://picsum.photos/200/300?random=4'},
            {src: 'https://picsum.photos/200/300?random=5'}
          ]}
          xRotation="-30deg"
          perspective="1000px"
          zTranslation="200px"
          className="imageSlider"
        />

Props

PropDefault ValueRequiredDescriptionData Type
imagesN/AYesAn array of objects containing src attribute e.g. [{ src: 'url to image'}]Array of objects with key src of type string
perspective1000pxNovalue of perspective transformation is the distance between z=0 and userstring
xRotation20degNovalue of rotation of the slider around the X axisstring
zTranslation300pxNodistance between z=0 and itemsstring
classNameimageSliderNoclassName of the container divstring
animationDuration3sNoDuration of the animationstring
animationTimingFunctionlinearNoTiming function of the animationstring
animationIterationCountinfiniteNoCount of the animation's iterationsstring
animationDirectionnormalNodirection of the animationstring
animationDelay0sNodelay before start of the animationstring
animationFillMode0sNoanimation fill mode css: animation-fill-modestring
0.3.1

10 months ago

0.2.1

10 months ago

0.1.2

11 months ago

0.1.1

11 months ago

0.1.0

11 months ago