Learn about our RFC process, Open RFC meetings & more.Join in the discussion! »

@corex/use-swiper

2.0.8 • Public • Published

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

Install

npm i @corex/use-swiper

DownloadsWeekly Downloads

100

Version

2.0.8

License

MIT

Unpacked Size

2.27 kB

Total Files

6

Last publish

Collaborators

  • avatar