A tiny React Carousel Component.
yarn add react-carousel-lite -S
import 'react-carousel-lite/dist/index.css'
import Carousel from 'react-carousel-lite'
export function App() {
return (
<Carousel autoplay>
// {...content}
</Carousel>
)
}
Name | Type | Default | Description |
---|---|---|---|
autoplay | Boolean | false | A boolean indicates whether to play automatically |
dotPosition | left/right/top/bottom | bottom | Carousel dot position |
easing | CSSProperties['animationTimingFunction'] | linear | css animationTimingFunction |
effect | slide/fade | slide | The effect type |
interval | Number | 2000 ms | The time interval of the slider change |
beforeChange | Function | NOOP | beforeChange will be triggered before slide change |
afterChange | Function | NOOP | afterChange will be triggered after slide changed |
children | ReactNode | - | Slide content |