react-hook-slider
v1.0.1
Published
Custom horizontal slider with full control over design
Downloads
6
Readme
react-hook-slider
Description
An horizontal slider using React hooks that allows to have full control over the design and behavior of the component, simple and easy to use.
Installation
yarn
yarn add react-hook-slider
npm
npm install react-hook-slider
Usage
The hook returns an object with properties that allow the slider to be controlled: a ref
to the slider element, a scrollTo
function to scroll the slider left or right, a scrollStatus
variable that represents the current scroll position of the slider and isOverflown
, a function that indicates whether or not the slider content is overflowing its container, in my case this was used to hide or show the slider arrows when there are no enough elements on the list to do the scroll action.
See it in action here
Contributions to our GitHub are welcome.