Scroll to any element of your React application
npm install react-scroll-to-elementnpm install react-scroll-to-element`
or
`yarn add react-scroll-to-element`
2. Options
| Option | Value | Description |
| ------------------- |:-------------:| -------------------------------------------------------------------- |
| `type` | `string` | `id` or `class` - Not required if you want to set offset only|
| `element` | `string` | Scroll to this element (use with `type`) |
| `offset` | `number` | Scroll `x` pixels down |
| `timeout` | `number` | Start scrolling after `x` ms |
| `children` | `string` | Text or html tags |
3. Usage
`js
import Scroll from 'react-scroll-to-element';
Scroll to element with id 'title'
Scroll to element with class 'contact'
Scroll to top
Scroll 200 px down (from top)
Scroll 200 px down (from top) after 3 seconds
Scroll to element with class 'contact' + 200 px down after 3 seconds
Scroll to element with class 'contact' - 100 px
`
You can also use html tags inside the component
`js
``