Skip to content
zenui/react-hooks

useLockBodyScroll

Stop the page behind a modal, drawer or menu from scrolling. Nested locks are counted, and the scrollbar width is padded so the layout does not shift.

Level
Basic
Since
v1.0.0
import {useLockBodyScroll} from '@zenuilabs/react-hooks';
Loading demo_

More in Events & DOM