Package Exports
- @corex/use-swiper
This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (@corex/use-swiper) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.
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