Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/liammartens/use-basicscroll

Simple package to use Basicscroll with React
https://github.com/liammartens/use-basicscroll

Last synced: 11 days ago
JSON representation

Simple package to use Basicscroll with React

Awesome Lists containing this project

README

        

# use-basicscroll
[![use-basicscroll](https://img.shields.io/npm/v/use-basicscroll)](https://www.npmjs.com/package/use-basicscroll)

Simple React hook to add [basicscroll](https://www.npmjs.com/package/basicscroll#demos) 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

```jsx
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 (


)
};
```