@svelte-put/lockscroll
v2.0.0
Published
locking scroll and hide scrollbar within an HTML element
Downloads
469
Readme
@svelte-put/lockscroll
Svelte action use:lockscroll
- locking scroll within an HTML element
svelte-put
This package is part of the @svelte-put family. For contributing guideline and more, refer to its readme.
Usage & Documentation
See the dedicated documentation page here.
Quick Start
<script>
import { lockscroll } from '@svelte-put/lockscroll';
let locked = $state(false);
</script>
<svelte:body use:lockscroll={locked} />
<button onclick={() => locked = !locked}>Toggle lock scroll on body</button>