react-smoothy-scroll
v0.9.3
Published
my own npm package smooth scroll in reactjs
Downloads
6
Readme
react-smoothy-scroll
Smooth scrolling for React.js with easy to use component(Not supported in React Native)
Installation
With Yarn
yarn add react-smoothy-scroll
With NPM
npm i react-smoothy-scroll
Basic Usage
import SmoothScroll from "react-smoothy-scroll";
<SmoothScroll toId="navbar" duration={1500} allowScroll={true}>
<p>Scroll To Navbar</p>
</SmoothScroll>;
Properties
| Prop | Default | Type | Description |
| :---------- | :-------: | :---------: | :------------------------------------- |
| toId | undefined | string
| target id for smooth scrolling |
| toRef | null | RefObject
| target ref object for smooth scrolling |
| duration | 1000 | number
| duration of the smooth scroll |
| children | undefined | ReactNode
| react children |
| allowScroll | true | bool
| if false
scrolling will be disabled |
Inspired by Filip Kubík