1.0.10 • Published 6 years ago

@danah/react-hook-scrollto v1.0.10

Weekly downloads
-
License
MIT
Repository
github
Last release
6 years ago

@danah/react-hook-scrollto

React Hook to makes scrolling the document to the specified coordinates easy.

Installation

- yarn

yarn add @danah/react-hook-scrollto

- npm

npm i @danah/react-hook-scrollto

Usage

import React from "react";
import scrollTo from "@danah/react-hook-scrollto";

function App() {
  scrollTo({
    x: 25,
    y: 10,
    id: "foo",
    smooth: true
  });

  return <h1 id="foo">Hello Hooks</h1>;
}

Arguments

ArgumentTypeDescriptionRequired
xnumberSet the horizontal x position to scroll tono
ynumberSet the vertical y position to scroll tono
idstringSet the ID of the ScrollArea we want to scrollno
smoothstringIf true, this will animate the scroll to be smooth. False will give an instant scroll. (defaults: false)no

Return

No return value

1.0.10

6 years ago

1.0.9

6 years ago

1.0.8

6 years ago

1.0.7

6 years ago

1.0.6

6 years ago

1.0.5

6 years ago

1.0.4

6 years ago

1.0.3

6 years ago

1.0.2

6 years ago

1.0.1

6 years ago

1.0.0

6 years ago