react-rotation-slider
v1.0.7
Published
react rotation slider
Downloads
9
Maintainers
Readme
react-rotation-slider
Install
npm i react-rotation-slider
Usage
import React, { Component } from 'react'
import { ReactRotationSlider } from 'react-rotation-slider'
import 'react-rotation-slider/dist/index.css'
const Example = ()=> {
let images = [img1,img2,img3,...]
render() {
return <ReactRotationSlider images={images}/>
}
}
other parameters
const Example = ()=> {
let images = [img1,img2,img3,...]
render() {
return <ReactRotationSlider images={images} borderColor={"#e33650"}
autoSlide={5000} showBtns={true} />
}
}
Custom buttons using methods
import React, {useRef} from "react";
const Example = ()=> {
// ref to ReactRotationSlider
const ref = useRef();
let images = [img1,img2,img3,...]
render() {
return <>
<ReactRotationSlider images={images} ref={ref}/>
<p onClick={() => ref.current.next()}>
Next
</p>
<p onClick={() => ref.current.prev()}>
Next
</p>
</>
}
}
Donate Me
Your support motivates me to provide open source works. Thank you ❤️ :
TRX : TJ6AvqZrH1N1Y51r6uMZqxWncrwy3ANac5
USDT : 0x048C5aB5125aF59b2B589090Ea218E46927dAF74
License
MIT © SinaRezvaniTech