This package is part of the @svelte-put family. For contributing guideline and more, refer to its readme.
See the dedicated documentation page here.
<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>