npm

@ian_test_nooks/use-scroll

1.0.0 • Public • Published

@ian_test_nooks/use-scroll

React Hook to check scroll position when slide scroll

npm i @ian_test_nooks/use-scroll

const { current X, current Y } = useScroll(offsetX, offsetY);

import useScroll from "@ian_test_nooks/use-scroll";

const App = () => {
  const { x, y } = useScroll(offsetX, offsetY);
  return (
    <div className="App" style={{ height: "1000vh" }}>
      <h1 style={{ position: "fixed", color: y > 100 ? "red" : "green" }}>
        hello
      </h1>
    </div>
  );
};

Readme

Keywords

Package Sidebar

Install

npm i @ian_test_nooks/use-scroll

Weekly Downloads

1

Version

1.0.0

License

MIT

Unpacked Size

1.66 kB

Total Files

4

Last publish

Collaborators

  • iian