Skip to content

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

10 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

@hornbeck/scroll-lock

Simple and lightweight scroll lock for react and vanilla js.

npm install --save @hornbeck/scroll-lock

Documentation

React hook

import { useScrollLock } from "@hornbeck/scroll-lock";

function App() {
  const [lockScroll, setLockScroll] = React.useState(false);

  useScrollLock(lockScroll);
}

Vanilla js

import { scrollLock } from "@hornbeck/scroll-lock";

// Turn on scroll lock.
const off = scrollLock();

// Turn off scroll lock.
off();

About

No description, website, or topics provided.

Resources

Stars

1 star

Watchers

1 watching

Forks

Releases

Packages

Used by

Contributors

Languages