use-swiper
v1.2.1
Published
A react based use hook for carousel
Downloads
193
Maintainers
Readme
Installation
yarn
yarn add use-swiper
npm
npm install use-swiper
include css
import "use-swiper/lib/swiper.min.css";
Basic Usage
import React from "react";
import useSwiper from "use-swiper";
const App = () => {
const { ref } = useSwiper();
const list = [1, 2, 3, 4, 5];
return (
<div ref={ref}>
{list.map(item => (
<div key={item}>{item}</div>
))}
</div>
);
};