React-Hook-Scroll ยท
React-Hook-Scroll is a UI library for React projects that allows users to choose a value through scrolling. It is designed to be compatible with both desktop and mobile environments.
Install
npm i react-hook-scroll
Example
import { useState } from "react";
import { VirtualScroll } from "react-hook-scroll";
function App() {
const [selected, setSelected] = useState(null);
return (
<div className="App">
<VirtualScroll list={[1, 2, 3, 4, 5]} onItemSelected={setSelected} />
</div>
);
}
The VirtualScroll component requires two required profiles.
- list: need a list to let the user choose.
- onItemSelected: The action to be taken with the item selected by the user is required.
Contributing
Development happens in the open on GitHub and we are grateful for contributions including bug fixes, improvements, and ideas.
License
React-Hook-Scroll is MIT licensed.