Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
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
- Host: GitHub
- URL: https://github.com/liammartens/use-basicscroll
- Owner: LiamMartens
- Created: 2021-11-11T23:13:54.000Z (about 3 years ago)
- Default Branch: master
- Last Pushed: 2021-11-11T23:41:57.000Z (about 3 years ago)
- Last Synced: 2024-10-18T16:13:33.997Z (2 months ago)
- Language: TypeScript
- Size: 56.6 KB
- Stars: 0
- Watchers: 3
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
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 (
)
};
```