Sign Up for Free

RunKit +

Try any Node.js package right in your browser

This is a playground to test code. It runs a full Node.js environment and already has all of npm’s 400,000 packages pre-installed, including @corex/use-swiper with all npm packages installed. Try it out:

var useSwiper = require("@corex/use-swiper")

This service is provided by RunKit and is not affiliated with npm, Inc or the package authors.

@corex/use-swiper v2.0.9


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

Metadata

RunKit is a free, in-browser JavaScript dev environment for prototyping Node.js code, with every npm package installed. Sign up to share your code.
Sign Up for Free