Giter Site home page Giter Site logo

mt-carousel's Introduction

mt-carousel

A light-weight React mt-carousel component with extremely easy API(只适用于移动端项目). Online Demo, welcome code review

Installation

npm install mt-carousel --save

Usage

import img1 from './static/images/11.jpg';
import img2 from './static/images/12.jpg';
import img3 from './static/images/13.jpg';
import img4 from './static/images/14.jpg';
import img5 from './static/images/15.jpg';
import Carousel from 'mt-carousel';

const source = [img1, img2, img3, img4, img5];
export default class App extends PureComponent {
  render() {
    return (
      <div className="container">
        <Carousel
          interval={5000}
          autoPlay={false}
          indicatorSize="middle"
          indicatorColor="#f80"
          indicatorClass="indicator"
        >
          {
            source.map((item, key) =>
              <a
                href="javascript:;"
                className="carousel-item-a"
                key={key}
              >
                <img
                  src={item}
                  alt="轮播图"
                  className="carousel-item-a-img"
                />
              </a>
            )
          }
        </Carousel>
      </div>
    );
  }
}

props

param detail type default
children collection of child nodes, array []
interval carousel time number 3000
autoPlay whether to loop bool true
indicatorSize indicator style size string 'middle'
indicatorColor indicator style color string '#f80'
indicatorClass indicator class name string ''

mt-carousel's People

Watchers

James Cloos avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.