@corex/use-swiper
v4.0.43
Published
--- title: '@corex/use-swiper' custom_edit_url: 'https://github.com/iamvishnusankar/corex/edit/master/packages/use-swiper/README.md' ---
Downloads
215
Readme
title: '@corex/use-swiper' custom_edit_url: 'https://github.com/iamvishnusankar/corex/edit/master/packages/use-swiper/README.md'
Example Usage
import React from 'react'
import useSwiper from '@corex/use-swiper'
const CustomCarousel = () => {
const containerRef = React.useRef()
useSwiper(containerRef, {
direction: 'horizontal',
loop: true,
})
return (
<div className="swiper-container" ref={containerRef}>
<div className="swiper-wrapper">
{[0, 1, 2, 3, 4].map((_, index) => (
<div key={index}>Slide {index}</div>
))}
</div>
<div className="swiper-pagination" />
</div>
)
}
export default CustomCarousel