1.0.3 • Published 2 years ago

use-basicscroll v1.0.3

Weekly downloads
-
License
MIT
Repository
-
Last release
2 years ago

use-basicscroll

use-basicscroll

Simple React hook to add basicscroll to your React project.

Installation

Install use-basicscroll and basicscroll itself.

yarn add use-basicscroll basicscroll

Usage

Use the hook with a ref and basic scroll config

import { useBasicScroll } from "use-basicscroll";

export const Component = () => {
  const ref = useRef();
  const instance = useBasicScroll(ref, {
    from: '0',
    to: '100px',
    props: {
      '--opacity': {
        from: 0,
        to: 1,
      },
    },
  });

  return (
    <div ref={ref}></div>
  )
};
1.0.3

2 years ago

1.0.2

2 years ago

1.0.1

2 years ago

1.0.0

2 years ago