0.1.1 • Published 5 years ago

react-carousel-gallery v0.1.1

Weekly downloads
2
License
MIT
Repository
github
Last release
5 years ago

React Carousel Gallery

A carousel to use for a gallery usecase.

Preview

npm.io

Tools used

  1. Used IntersectionObserver API.
  2. Used a separate image component for changing layout from 'portrait' to 'landscape'

Note

This is a very basic component for now. Will improve it and also add some test cases.

TODOs,

  1. Add buttons to let user scroll (Currently gesture scroll is enabled).
  2. Make the component more generic to take props from outside components.
  3. If possible make the transition go proportional to the amount of intersection of the visible image. So the image gradually scales to its maximum value once it is fully visible.

Usage

import { Carousel } from 'react-carousel-gallery'

const images = [...];

const Demo = props => {
    return (
        <div>
            <Carousel images={images} imageHeight={600} imageWidth={600} />
        </div>
    );
};