2.0.1 • Published 4 years ago

react-instagram-carousel v2.0.1

Weekly downloads
6
License
MIT
Repository
github
Last release
4 years ago

react-instagram-carousel

carousel for React that like instagram story.

MIT License

Tech

Installation

npm install [--save-dev] react-instagram-carousel

Usage

import React from 'react';
import Carousel from 'react-instagram-carousel';

const images = [
  '/img/example1.jpg',
  '/img/example2.jpg',
  '/img/example3.jpg'
];

const App = () => {
  return (
    <div style={{width: '400px', height: '600px'}}>
      <Carousel images={images} />
    </div>
  );
}

export default App;

TypeScript:

import React from 'react';
import Carousel from 'react-instagram-carousel';

const images: string[] = [
  '/img/example1.jpg',
  '/img/example2.jpg',
  '/img/example3.jpg'
];

const App: React.FC = () => {
  return (
    <div style={{width: '400px', height: '600px'}}>
      <Carousel images={images} />
    </div>
  );
}

export default App;

Props

<Carousel
  images={images}
  nextMsec={3000}
  barHeight={3}
  backgroundSize={'contain'}
  backgroundColor={'white'} />
PropsTypeDefaultRequiredDescription
imagesstring[]YesURL for images. must length 2 or more.
nextMsecnumber5000Notime until next image. unit is msec.
barHeightnumber1.5Noheight for progress bar. unit is px.
backgroundSize'cover' or 'contain''cover'Nobackground-size property for CSS.
backgroundColorstring#202322Nobackground-color property for CSS.

Example

$ git clone git://github.com/hktysk/react-instagram-carousel.git
$ cd react-instagram-carousel
$ npm install
$ npm start
2.0.1

4 years ago

2.0.0

4 years ago

1.1.1

4 years ago

1.1.0

4 years ago

1.0.2

4 years ago

1.0.1

4 years ago

1.0.0

4 years ago