@corex/use-swiper
TypeScript icon, indicating that this package has built-in type declarations

4.0.43 • 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

Dependencies (1)

Dev Dependencies (0)

    Package Sidebar

    Install

    npm i @corex/use-swiper

    Weekly Downloads

    90

    Version

    4.0.43

    License

    MIT

    Unpacked Size

    3.24 kB

    Total Files

    5

    Last publish

    Collaborators

    • iamvishnusankar