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