mt-react-carousel
A light-weight React react-carousel-comp component with extremely easy API(只适用于移动端项目). Online Demo, welcome code review
Installation
npm install react-carousel-comp --save
Usage
;;;;;; // 屏幕宽度const screenWidth = windowscreenwidth || documentdocumentElementclientWidth || documentbodyclientWidth; const source = img1 img2 img3 img4 img5; { return <div className="container"> <Carousel interval=5000 autoPlay=false indicatorSize="middle" indicatorColor="#f80" > source </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' |