Ginioo / img-carousel

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

@ginioo/simple-carousel

a simple carousel for images or else

  1. install
npm i -D @ginioo/simple-carousel
  1. add ImageCarousel to a component
import React, {Component} from 'react';
import {ImageCarousel} from '@ginioo/simple-carousel';

class SampleComponent extends Component {

  render() {
    return (
      <div id="sample">
        // default slide to the right
        <ImageCarousel src="http://via.placeholder.com/350x150" />
        
        <ImageCarousel slide="left" src={[
            "http://via.placeholder.com/350x150",
            "http://via.placeholder.com/350x150",
        ]} />
      </div>
    );
  }
}

export default SampleComponent;
  1. define #simple-carousel height and width
#simple-carousel {
  width: 1024px;
  height: 440px;
}

About


Languages

Language:JavaScript 63.8%Language:CSS 36.2%