0.0.2 • Published 5 years ago

@wyhaya/react-slide v0.0.2

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

react-slide

React carousel component for mobile

slide

Install

yarn add @wyhaya/react-slide

Example

Component styles use styled-components

import Slide from 'react-slide'

const imgs = ['1.jpg', '2.jpg', '3.jpg']

ReactDOM.render(
    <Slide data={imgs} />,
    document.getElementById('root')
)

Interface

PropsTypeDefaultExplain
datastring[][]Picture list
time?number3000msTimed scrolling time
spot?booleantrueWhether to display the index
speed?number300msTransition speed
type?ease \| linear \| ease-in \| ...easeTransition mode
clockwise?booleantrueWhether to scroll clockwise
onClick?(index: number) => void-Callback function after clicking
onChange?(index: number) => void-Change the callback function after the index
onPrev?(index: number) => void-Callback function after index forward
onNext?(index: number) => void-Callback function after index backwards

License

MIT LICENSE