semantic-ui-carousel-react v1.1.3
Semantic-ui-carousel-react
Carousel component for semantic ui react
install
npm i semantic-ui-carousel-reactprops
- elemntsArray : a n array of json objects each with render keyword which is a function that return a valid JSX
durationNumber : a number that indicates the auto scrolling speed if this prop is absent then auto scrolling will get disabled
animationString : a text that specifies sliding animation which should be valid value for Transition component for semantic-ui-react so avilable options are
browsebrowse rightdropfadefade upfade downfade leftfade rightfly upfly downfly leftfly righthorizontal flipvertical flipscaleslide upslide downslide leftslide rightswing upswing downswing leftswing rightzoomjiggleflashshakepulsetadabounceglowshowNextPrevBoolean : decides that if the carousel should display next an previous buttons on the slider
showIndicatorsBoolean : decides that if the carousel should display indicators for slides which is also a navigation option like next an previous buttons
onSlideChange(index, element)function : callback function called everytime a slide changes
See also the live example usage example
import React from 'react';
import Carousel from 'semantic-ui-carousel-react';
import { Image, Button } from 'semantic-ui-react'
const App = () => {
let elements = [
{
render:()=>{
return <Button fluid>1111111</Button>
}
},
{
render:()=>{
return <Button fluid>2222222</Button>
}
},
]
return (
<div>
<Carousel
elements = { elements }
duration ={3000}
animation ='slide left'
showNextPrev = {false}
showIndicators ={true}
/>
</div>
)
}
export default App;