0.0.2 • Published 1 year ago
scroll-util v0.0.2
Installation
# npm
npm install scroll-util
# yarn
yarn add scroll-util
Usage
React
import { scrollToElement } from "scroll-util";
import { useEffect } from "react";
function MyComponent() {
return (
<button onClick={() => scrollToElement("my-div")}>Click me!</button>
<div id="my-div" style={{
height: "100vh",
width: "100%"
}}>
<span>My div</span>
</div>
);
}
Browser
scroll-util currently does not support browser JS but will do so in the future.
Note: documentation in development
Links
License
This project is licensed under the Apache-2.0 license.