0.3.2 • Published 6 years ago

mw-carousel v0.3.2

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

mw-carousel

build status npm version Download Count

mw-carousel based on react-swipe. So the basic usage will be similar.

Demo

Check out the demo from a mobile device (real or emulated).

Install

npm install mw-carousel

Usage

Example

import React from 'react'
import ReactDOM from 'react-dom';
import ReactSwipe from 'mw-carousel';

class Carousel extends React.Component {
    render() {
        return (
            <ReactSwipe className="carousel" swipeOptions={{continuous: false}}>
                <div>PANE 1</div>
                <div>PANE 2</div>
                <div>PANE 3</div>
            </ReactSwipe>
        );
    }
}

ReactDOM.render(
    <Carousel />, 
    document.getElementById('app')
);

Props

  • swipeOptions: ?Object - supports all original options from
  • style: ?Object - object with 3 keys (see defaults):
    • container: ?Object
    • wrapper: ?Object
    • child: ?Object
  • regular props as className, id for root component are also supported
property name(字段名称)类型default(默认值)
swipeOptions.startSlidePropTypes.number0
swipeOptions.speedPropTypes.number300(ms)
swipeOptions.autoPropTypes.number3000(ms),停顿时间
swipeOptions.continuousPropTypes.boolfalse, 是否循环播放
swipeOptions.disableScrollPropTypes.booltrue, 禁止滚动
swipeOptions.stopPropagationPropTypes.booltrue
swipeOptions.callbackPropTypes.func(index, slide) => {...} index: 序号;slide: 当前element
idPropTypes.stringid
classNamePropTypes.stringclassname
style.containerPropTypes.object{height: '300px'}...
style.wrapperPropTypes.object{height: '300px'}...
style.childPropTypes.object{height: '300px'}...

Methods

Component proxies all Swipe.js instance methods.

<ReactSwipe>
    {images}
</ReactSwipe>

MIT Licensed

0.3.2

6 years ago

0.3.1

6 years ago

0.3.0

6 years ago

0.2.9

6 years ago

0.2.8

6 years ago

0.2.7

6 years ago

0.2.6

6 years ago

0.2.5

6 years ago

0.2.4

6 years ago

0.2.3

6 years ago

0.2.2

6 years ago

0.2.1

6 years ago

0.2.0

6 years ago

0.1.9

6 years ago

0.1.8

6 years ago

0.1.7

6 years ago

0.1.6

6 years ago

0.1.5

6 years ago

0.1.4

6 years ago

0.1.3

6 years ago

0.1.2

6 years ago

0.1.1

6 years ago

0.1.0

6 years ago